Results 1 to 2 of 2
Given the name of a mounted volume (e.g., /mnt/vol), how would I determine its capacity and available space in C?
I've been googling for a while now and nothing jumps ...
- 11-15-2010 #1Just Joined!
- Join Date
- Nov 2010
- Posts
- 11
How to find available space in a volume?
Given the name of a mounted volume (e.g., /mnt/vol), how would I determine its capacity and available space in C?
I've been googling for a while now and nothing jumps out as the solution. I can use getmntent() to get the name of the actual partition that is associated with the mount point, e.g. /dev/sda2, but I can't figure out how to find the capacity of the volume nor how much space is remaining, such as what the df command shows.
Is there an ioctl defined to get this information or some other system call?
- 11-15-2010 #2Just Joined!
- Join Date
- Nov 2010
- Posts
- 11
Found it--statfs(). That gives me what I need....


Reply With Quote