Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: statfs and 64bit file lengths?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: statfs and 64bit file lengths?




On Dec 1, 2006, at 2:37 PM, email@hidden wrote:

How do I determine the amount of free disk on a volume on OSX 10.4.x? The *nix statfs() API seems limited to 32bit file lengths, unless i'm misunderstanding something. Can someone send me a quick example of how to do this?

[dualg5:~/temp] steve$ cat statfs.c #include <sys/param.h> #include <sys/mount.h> #include <stdio.h>

int main()
{
        struct statfs fs;

        statfs( "/", &fs );
        printf( "%ld, %ld, %lld\n", fs.f_bsize, fs.f_bfree,
               (int64_t)fs.f_bsize*fs.f_bfree );
        return 0;
}
[dualg5:~/temp] steve$ gcc -Wall statfs.c
[dualg5:~/temp] steve$ ./a.out
4096, 16022995, 65630187520

--
Steve Checkoway



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >statfs and 64bit file lengths? (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.