tridiak <mailto:trid...@ihug.co.nz>
March 5, 2016 at 9:14 PM


I want a way to know a file what a file's new name is.
Having event ID X (old name) & X+1 (new name) for file rename (& move) would be really useful.

Is there another way to find out what a file's new name is? I am currently iterating through the parent directory comparing file sys IDs to get the new name.
A file's file ID will never changed under rename (or move*)?

A simpler approach would probably be to create a bookmark of the original file and make sure the bookmark data prefers the file ID (kCFURLBookmarkCreationPreferFileIDResolutionMask). Then, all you have to do is resolve the bookmark and get the file's new name and location (from the returned file URL). Very fast, very neat.

Optionally, if you use NSURL to create the bookmark, you can include the URL's original filename (as an URL resource) in the bookmark data. Later, the bookmark will provide both the original name (saved during creation) and its new name (obtained after resolution).

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (Filesystem-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/filesystem-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to