Created
February 8, 2012 19:22
-
-
Save kyleturner/1772502 to your computer and use it in GitHub Desktop.
Find the amount of free space on hard drive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDictionary* fileAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:@"/" | |
error:&error]; | |
unsigned long long freeSpace = [[fileAttributes objectForKey:NSFileSystemFreeSize] longLongValue]; | |
NSLog(@"free disk space: %dGB", (int)(freeSpace / 1073741824)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment