Is it possible to detect remaining disk space in device?

Discussion in 'iOS Programming' started by fenrus110, Jan 16, 2009.

  1. fenrus110 macrumors regular

    Mar 24, 2008
    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.
  2. Pring macrumors 6502

    Sep 17, 2003
    	NSDictionary *fsAttr = [[NSFileManager defaultManager] fileSystemAttributesAtPath:NSHomeDirectory()];
    	unsigned long long freeSpace = [[fsAttr objectForKey:NSFileSystemFreeSize] unsignedLongLongValue];
    will return the free space available to you, in bytes

Share This Page