Re: Globally, persistently identifying a file
Re: Globally, persistently identifying a file
- Subject: Re: Globally, persistently identifying a file
- From: comex <email@hidden>
- Date: Thu, 26 Apr 2012 20:01:17 -0400
On Thu, Apr 26, 2012 at 6:48 PM, Nick Zitzmann <email@hidden> wrote:
>> On Thu, Apr 26, 2012 at 2:09 PM, Nick Zitzmann <email@hidden> wrote:
>>> I need to be able to identify a file globally and persistently (such that it still works after moving or overwriting a file, or re-mounting a volume, or after rebooting). File paths don't work, because even though they're technically unique, they break if the file or its underlying path components are renamed or moved. Carbon FSSpec data structures don't work, because they're not available to 64-bit apps. Cocoa NSURLFileResourceIdentifier objects don't work, because they aren't persistent across reboots.
>>
>> Are these your own filetypes that you're monitoring?
>
> They aren't.
You could get a reasonable ID with getattrlist and
ATTR_CMN_OBJPERMANENTID + ATTR_VOL_UUID, but you should try to ensure
you're not seeing a reused object ID, perhaps by checking the file's
creation date (ATTR_CMN_CRTIME or st_birthtime).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden