I have a path to file contained in an NSString. Is there a method to get its file size?
Bear in mind that fileAttributesAtPath:traverseLink: is deprecated as of Mac OS X v10.5. Use attributesOfItemAtPath:error: instead, described at the same URL thesamet mentions.
With the caveat that I'm an Objective-C newbie, and I'm ignoring errors that might occur in calling attributesOfItemAtPath:error:, you can do the following:
NSString *yourPath = @"Whatever.txt";
NSFileManager *man = [NSFileManager defaultManager];
NSDictionary *attrs = [man attributesOfItemAtPath: yourPath error: NULL];
UInt32 result = [attrs fileSize];