Using "statfs" on Mac OS X?

I need to get information about the hard drive, and I use the statfs function to do this.

  • When your computer displays free space on HD, does it use “free blocks” or “free blocks available for an unprivileged user”?
  • Does statfs work with SSD?
  • How will the "path" to the main hard drive be stored? On Windows, this is generally C :, but I'm new to OSX.

The manual pages do not seem to provide a very detailed description of how statfs works.

Mac OSX Snowleopard using C / Objective-C. Xcode 3.2.6

+2
c objective-c hardware hard-drive macos
source share
1 answer

1) See man statfs ; the returned structure has both available quantities ( f_bfree and f_bavail ). ¹

2) Yes, it works on file systems, not hard drives, so it does not matter what type of hard drive (if any) the file system is on.

3) /

¹ If the first part of the question was not about what statfs returns, but about what “computer” displays in general, I think that the answer depends on the program used to display the amount of free space. Compare the two values ​​returned by statfs with the programs displayed that interest you.

+2
source share

All Articles