Search code examples
iosnsfilemanager

NSFileManager - Check file size?


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


Solution

  • you can use :

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

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