Re: finding how much the file system is full, from a C program?
- From: Iwo Mergler <Iwo.Mergler@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Oct 2006 10:19:04 +0000
prasadjoshi124@xxxxxxxxx wrote:
Hi All,
I am writing a small tool which is supposed to fill the filesystem to a
specified percent.
For, that I need to read how much the file system is full in percent,
like the output given by df -k
lopgod10:~/mycrfile # df -k /mnt/mvdg1/vset
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vx/dsk/mvdg1/vsetdg1
1536000 349854 1112370 24% /mnt/mvdg1/vset
How can I do it from a C program.
df is a C program and it's open source. It's part of the
GNU fileutils which is part of the GNU coreutils.
Source code is available here.
http://ftp.gnu.org/pub/gnu/coreutils/
As others have said, this is not portable C. Which means,
you may as well write a shell script which invokes df and,
say, dd to do the job.
Kind regards,
Iwo
.
- References:
- finding how much the file system is full, from a C program?
- From: prasadjoshi124
- finding how much the file system is full, from a C program?
- Prev by Date: need for an extra variable.
- Next by Date: Re: not writing to file
- Previous by thread: Re: finding how much the file system is full, from a C program?
- Next by thread: structure pointers
- Index(es):
Relevant Pages
|
|