Showing posts with label fileSystemFileNumber example. Show all posts
Showing posts with label fileSystemFileNumber example. Show all posts

Thursday, May 9, 2013

NSDictionary fileSystemFileNumber example ios


fileSystemFileNumber

Returns the value for the key NSFileSystemFileNumber.
- (NSUInteger)fileSystemFileNumber
Return Value
The value, as an unsigned long, for the key NSFileSystemFileNumber, or 0 if the dictionary doesn’t have an entry for the key
Discussion of [NSDictionary fileSystemFileNumber]
This and the other file... methods are for use with a dictionary, such as those returned from the methodsfileAttributesAtPath:traverseLink: (NSFileManager), directoryAttributes(NSDirectoryEnumerator), and fileAttributes (NSDirectoryEnumerator), that represents the POSIX attributes of a file or directory. This method returns the file’s inode.
Example of [NSDictionary fileSystemFileNumber]
CLMFileManagedObj *clmf;
clmf = (CLMFileManagedObj *)[NSEntityDescription insertNewObjectForEntityForName:@"CLMFile" inManagedObjectContext:moc];

NSUInteger fsfn = [dict fileSystemFileNumber];
[clmf setValue:[NSNumber numberWithUnsignedInteger:fsfn] forKey:@"iNodeNumber"];
[clmf setValue:(NSNumber*)[dict objectForKey:NSFileReferenceCount] forKey:@"referenceCount"];