osx - How I detect whether or not a file has been renamed using Cocoa? -
I am creating a utility application that synchronizes files in two systems for Mac OSX. I have to find out when the name of a file has been changed but otherwise the same file. How can I do this in Cocoa?
There is no easy answer; You have to understand the best strategy for your app.
Working with a file system number at a simple level. You can get it by using NSFileSystemFileNumber . Probably better for a job, though using FSRef is a C API, but is relatively straightforward, and there is a way to compare FSRF for equality.
However, there are so many applications that the file is changing the replaced disk, its file number can disturb your code thoroughly, then consider using aliases Do this as a single system because the Finder uses a nickname file to track the goal of the file, or either of the alias managers (C API) or open source object-wrapper (eg, NDLIAS or BDLIAS). do yoga. A nickname will try its best to maintain the reference of a file by both files and file numbers.
Comments
Post a Comment