In the old days, I used to use FSRef
in order to track a file's location while I was working with it during my app's lifetime. They referenced a directory by their ID (inode) and the file name inside.
Nowadays, we are supposed to use NSURL
file references instead, which seems to be using full paths instead.
The problem I'm running into is that when the user changes the name of an enclosing folder, my NSURLs do not seem to track the change of the path, like FSRefs used to.
What are my options to keep tracking the files? I guess one would be to use bookmarks, but that seems overkill to me because I then have to resolve the bookmark every time I want to use the tracked file. I don't need tracking across app runs, and I may have to track 10000s of files, so I don't think bookmarks are the right choice for this.
And, in theory, I could run into race conditions where, if the user changes the path just between my resolving the bookmark and accessing the file. With FSRefs, this was never an issue.
Has Apple really broken this feature the Mac ever since we got HFS, or what am I missing?