Getting a Unique File ID from MDItem
Getting a Unique File ID from MDItem
- Subject: Getting a Unique File ID from MDItem
- From: Mike Manzano <email@hidden>
- Date: Wed, 18 Feb 2009 11:55:19 -0800
Hi all,
I'm doing some MDQuery stuff in my application, and it's working to
the point where I'm getting the appropriate notifications for
additions and removals to the subset of files that satisfy my query.
When I get these notifications, there's a list of MDItemRefs in the
notification's userInfo dictionary. I would like to use these
notifications as a way to update an internal list of files. Some of
the Apple examples pull an kMDItemPath out of the MDItemRefs, but the
problem is that paths are not a good unique ID for files. E.g., the
path provided for a file when it is first detected is different than
the path provided when the file is moved to the Trash. Worse yet, if
you delete the file from the terminal, the kMDItemPath is (null). In
this case, I know a file was deleted, but have no clue as to which one
without manually testing the existence of all files in my model.
Is there a unique ID for a file that I can extract from an MDItemRef
regardless of where it is, or if it was just deleted? I wasn't able to
find one after reading the docs several times. I'm probably missing
something obvious.
Thanks,
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden