Hi,
I get a negaitve number from trying to use this function can anyone help. see code below
NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:dbPath error:Error];
NSDictionary *fileSysAttributes = [fileManager fileSystemAttributesAtPath:dbPath];
NSNumber *FileSize = [fileAttributes objectForKey:NSFileSize];
NSNumber *FreeSpace = [fileSysAttributes objectForKey:NSFileSystemFreeSize];
NSLog(@"FileSystem = %@",fileSysAttributes); // gives good values
NSLog(@"File Size = %d", [FileSize longLongValue]); // gives good values
NSLog(@"System Space = %d",[FreeSpace longLongValue]); //shows -ve for 45GB space
long long Result = FreeSpace - FileSize;
NSLog(@"Result = %d",Result);
The first and second log statements give good results but the third shows a negative number when I'm trying to use the longLongValue of FreeSpace directly