Calculating volume free space
Calculating volume free space
- Subject: Calculating volume free space
- From: email@hidden
- Date: Sun, 15 Jan 2006 18:53:17 -0500 (EST)
- Importance: Normal
I would like to calculate the volume free space (a la Finder's Get Info)
but I am not getting the results I expected. I have code similar to the
following:
if(-1 == statfs(tmpDir, &buf)) {
// handle error
}
bytesFree = buf.f_bsize * buf.f_bfree;
The value I get for bytesFree is something strange; df shows I have
84226328 available (about 40GB, which checks with Finder) but the
bytesFree in the above calculation comes out to 438489088 (about 418 MB).
Obviously I am doing something incorrectly here.
Is there another API I should be using besides statfs? I couldn't find
anything appropriate in NSWorkspace or NSFileManager.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden