Can anyone tell me, how to get disk storage used amount in Objective-C (ex. music - 1Gb, images - 100Mb, ..., free space - 5Gb)?
UPD: I wrote this:
NSError *error = nil;
NSDictionary* fileAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:@"/"error:&error];
unsigned long long freeSpace = [[fileAttributes objectForKey:NSFileSystemFreeSize] longLongValue];
unsigned long long totalSpace = [[fileAttributes objectForKey:NSFileSystemSize] longLongValue];
msg = [NSString stringWithFormat:@"free disk space: %dGB\n total disk space: %dGB", (int)(freeSpace / (1024*1024*1024)),(int)(totalSpace / (1024*1024*1024))];
But i actually need all info, about music, video, etc... like system info about disk (screenshot: http://cl.ly/image/1Y3Q3N1U3Q3A)