Possible Duplicate:
Why does the value from NSFileSystemFreeSize differ from the free size reported in the iOS Settings?
I have this code:
NSError *error = nil;
NSString *outputDirectory = @"/Users/myuser/Desktop"
NSDictionary *fileSystemAttributes =
[fileManager attributesOfFileSystemForPath:outputDirectory error:&error];
if (!error) {
uint64_t freeSpace = (uint64_t)[fileSystemAttributes objectForKey:NSFileSystemFreeSize];
NSLog(@"Free space in bytes: %lld.",freeSpace);
}
When I execute the code, it gives me around 45 TB of free space, which is totally wrong!
I have tried with
outputDirectory = @"/";
but it also fails.
Am I missing something? Thank you for your time.