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
You can call . fileSize() on attr to get file size.
The NSFileManager class provides convenient access to a shared file manager object that is suitable for most types of file-related manipulations. A file manager object is typically your primary mode of interaction with the file system. You use it to locate, create, copy, and move files and directories.
you can use :
- (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error
to get the file property dictionary and can fetch [dictObject valueForKey: @"NSFileSize"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With