where is info on free disk space stored (/proc?)
I'd like to know where on a linux system, information about the amount of free disk space is stored. Ultimately I'd like to parse this for use in a program.
I know I can see this info by just typing df, but I'd now love to find out how that program finds out about the free disk space. For a while, I thought this info might be stored in /proc/partitions: Code:
~>cat /proc/partitions Code:
~>cat /proc/partitions Anyone know the answer? Any replies most appreciated, --Matt |
While I'm not a C programmer, I thought it would be interesting to have a look at "df.c" and "stat.c". I am not entirely certain, but it would appear that the information is accessed through fuctions like "statfs" or "statvfs" (see man statfs for example). So I think the information comes from the kernel (like proc?), and not from some file.
I'd like to know more about this myself, so any corrections/additional info would be appreciated. Thanks in advance. JJ |
anyone ???
I'd really like to know too. Where the free disk space info is stored... I can't find it in /proc or /sys.. |
Try using:
Code:
stat -f /mnt/hda1 Code:
File: "/mnt/hda1" |
All times are GMT -5. The time now is 01:01 AM. |