NSFileManager - Check file size?

shannoga picture shannoga · Jan 13, 2012 · Viewed 7.4k times · Source

I am recording sound file in one of my apps. I am trying to figure out how to get the file size of the recorded file?

I know how to get it and it's path, I just can not figure out how to get the file size.

Thanks Shani

Answer

Saurabh Passolia picture Saurabh Passolia · Jan 13, 2012

you can use :

- (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error

to get the file property dictionary and can fetch [dictObject valueForKey: @"NSFileSize"];