Verify the size of a file called     input.txt     for a file in the current working directory, and another one in the file system root.




NSFileManager *fm = [NSFileManager defaultManager];
 
// Pre-OS X 10.5
NSLog(@"%llu", [[fm fileAttributesAtPath:@"input.txt" traverseLink:YES] fileSize]);
 
// OS X 10.5+
NSLog(@"%llu", [[fm attributesOfItemAtPath:@"input.txt" error:NULL] fileSize]);