I am creating an audio-recording application and I need to know how much disk space is available (not ram).
How can I retrieve it?
Thanks.
This is probably a useful example.
http://kdbdallas.com/2008/12/27/maciphone-show-availble-useable-diskspace/
Best solution for me is to use the NSFileManager method:
- (NSDictionary *)attributesOfFileSystemForPath:(NSString *)path error:(NSError **)error
on the directory where you want to save your data. This is a wrapper around the statfs
system call, as is mentioned in the docs. But if you're already using NSFileManager, this would be the way to go.
I haven't tried this, but since the iPhone is a UNIX based OS you should be able to get the free space on the flash file system using the statfs system call (see link for documentation).
Just use as parameter the path to the app directory that you plan to write to.