File path from NSFileSystemFileNumber
File path from NSFileSystemFileNumber
- Subject: File path from NSFileSystemFileNumber
- From: email@hidden
- Date: Sat, 8 Dec 2001 00:30:43 -0800
Hi Everybody,
In a program I'm writing I allow the user to import various files. I
want to keep track of these files even if the user moves them or renames
them. I believe this is possible using the file's SystemFileNumber,
which I obtain as follows:
NSNumber *fileID;
NSFileManager *manager = [NSFileManager defaultManager];
NSDictionary *fattrs = [manager fileAttributesAtPath:pathToFile
traverseLink:YES];
if (fattrs) {
fileID = [fattrs objectForKey:NSFileSystemFileNumber]
}
So now I have a unique fileID, which will remain the same for this file
regardless of whether the file is moved or renamed, right? Here's my
question: How do I obtain the full path to the file from this fileID so
that I may actually use the file later on? Or am I going about this all
wrong? Is there a better way to track references to files?
Thanks in advance!!