1 Jul 2003 01:28
Getting the "real" size of a file
I am attempting to get the size of a file using something akin to the following : NSNumber *fsize; NSFileManager *manager = [[NSFileManager alloc] init]; NSDictionary *fattrs = [manager fileAttributesAtPath:[ <at> "path to file"] traverseLink:NO]; fsize = [fattrs objectForKey:NSFileSize]; However NSFileSize returns the file size that you get when you do an "ls -l" in the terminal...not the file size as reported by the Finder. Oftentimes these sizes are quite different. Is there any way to retrieve the file size for a file so that it matches what is seen in the Finder? Thanks! -Bryan
RSS Feed