Re: statfs and 64bit file lengths?
Re: statfs and 64bit file lengths?
- Subject: Re: statfs and 64bit file lengths?
- From: Steve Checkoway <email@hidden>
- Date: Sat, 2 Dec 2006 02:28:58 -0800
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