Commit e2f46ea1 authored by Pierre SAGASPE's avatar Pierre SAGASPE Committed by Felix Paul Kühne
Browse files

function freeDiskspace : displaying APLog with right size and fix warning


Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent fe2988f7
...@@ -54,11 +54,13 @@ ...@@ -54,11 +54,13 @@
NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error]; NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error];
if (!error) { if (!error) {
totalSpace = [dictionary objectForKey: NSFileSystemSize]; totalSpace = [dictionary objectForKey:NSFileSystemSize];
totalFreeSpace = [dictionary objectForKey:NSFileSystemFreeSize]; totalFreeSpace = [dictionary objectForKey:NSFileSystemFreeSize];
APLog(@"Memory Capacity of %llu MiB with %llu MiB Free memory available.", (([totalSpace unsignedLongLongValue]/1024ll)/1024ll), (([totalFreeSpace unsignedLongLongValue]/1024ll)/1024ll)); NSString *totalSize = [NSByteCountFormatter stringFromByteCount:[totalSpace integerValue] countStyle:NSByteCountFormatterCountStyleFile];
NSString *totalFreeSize = [NSByteCountFormatter stringFromByteCount:[totalFreeSpace integerValue] countStyle:NSByteCountFormatterCountStyleFile];
APLog(@"Memory Capacity of %@ MiB with %@ MiB Free memory available.", totalSize, totalFreeSize);
} else } else
APLog(@"Error Obtaining System Memory Info: Domain = %@, Code = %i", [error domain], [error code]); APLog(@"Error Obtaining System Memory Info: Domain = %@, Code = %li", [error domain], [error code]);
return totalFreeSpace; return totalFreeSpace;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment