IPhone: available disk space

I am creating an application for recording sound, and I need to know how much free disk space (not ram).

How to get it?

Thanks.

+3
source share
3 answers

I have not tried this, but since iPhone is a UNIX-based OS, you should be able to get free space on the flash file system using statfs (see the documentation link).

Just use the path to the application directory that you plan to write as a parameter.

+5
source

The best solution for me is to use the NSFileManager method:

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

, . statfs, . NSFileManager, .

+4

Source: https://habr.com/ru/post/1714669/


All Articles