|
Home > Archive > Unix Programming > June 2005 > How can I get the size of free space of a logical volume in c language?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How can I get the size of free space of a logical volume in c language?
|
|
| HamburgerWang@gmail.com 2005-06-14, 8:52 pm |
| Are there any functions in c's library or unix's library?
And the header file name?
By the way, what function can read the size of a file quickly(not open
it)?
| |
|
|
Free space for a mounted partition:
statfs ( sys/vfs.h )
[ struct statfs - f_bfree * f_blocks ]
Size of a file:
stat ( sys/types.h, sys/stat.h, unistd.h )
[ struct stat - st_size ]
| |
| HamburgerWang@gmail.com 2005-06-15, 8:59 pm |
| Thanks,
but i got the values in HP UNIX:
f_bfree 418506
f_blocks 1540096
f_bsize 1024
418506 * 1024 = 428550114
while i use shell command, i got 393817kbytes
when i turned to use f_bavail, i got it.
Is it right?
|
|
|
|
|