Skip navigation.
 
mlRe: How to get free bytes and total bytes for volumes
FROM : Jean-Daniel Dupas
DATE : Fri Jan 04 13:30:20 2008

> NSLog(@"Total volume size: %i bytes", [self 
> getVolumeTotalBytesForPath: @"/Users/marc/Desktop"]);
> NSLog(@"Free volume size: %i bytes", [self 
> getVolumeFreeBytesForPath: @"/Users/marc/Desktop"]);
>
>
> i get something like 3 free bytes and 18 total bytes using a path
> on my PowerBook's harddrive which has 80GB total and 12GB free
> space. In the documentation for FSVolumeInfo it says :


using an 'unsigned long long' is fine but to log an 'unsigned long 
long' you have to use %llu and not %i

like this:
NSLog(@"Total volume size: %llu bytes", [self 
getVolumeTotalBytesForPath: @"/Users/marc/Desktop"]);
NSLog(@"Free volume size: %llu bytes", [self 
getVolumeFreeBytesForPath: @"/Users/marc/Desktop"]);

Related mailsAuthorDate
mlHow to get free bytes and total bytes for volumes Marc Lohse Jan 4, 11:33
mlRe: How to get free bytes and total bytes for volumes Jean-Daniel Dupas Jan 4, 13:30