PDA

View Full Version : Is it possible to detect remaining disk space in device?




fenrus110
Jan 16, 2009, 06:21 PM
Not sure if this is possible, but can you detect the amount of disk space left on the device? For an app that has a sqlite database and/or stores images or something, it could be a concern.



Pring
Jan 17, 2009, 09:14 AM
NSDictionary *fsAttr = [[NSFileManager defaultManager] fileSystemAttributesAtPath:NSHomeDirectory()];

unsigned long long freeSpace = [[fsAttr objectForKey:NSFileSystemFreeSize] unsignedLongLongValue];

will return the free space available to you, in bytes