will NSFileSystemFileNumber in iOS always be unique?
When using attributesOfItemAtPath:error:, is NSFileSystemFileNumber always guaranteed to be unique for the开发者_StackOverflow社区 device?
For example, I have a file with a certain NSFileSystemFileNumber, but a few days later I delete this file. If I create another file later on, is it possible that this new file can ever re-use the other file's NSFileSystemFileNumber, or will the NSFileSystemFileNumber always be unique?
Thanks!
NSFileManager Class Reference
NSFileSystemFileNumber
The key in a file attribute dictionary whose value indicates the file's filesystem file number. The corresponding value is an NSNumber object containing an unsigned long. The value corresponds to the value of st_ino, as returned by stat(2).
man 2 stat
ino_t st_ino; /* inode's number */
So this is an inode number. I believe inode can be reused by filesystem after original file is deleted.
The NSFileSystemFileNumber is just the file's inode number. It's unique to the file while the file exists, but once the file is gone, it could be reused at any time.
精彩评论