Kbase P151694: Sample C Code to get available disk space on Linux.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  25/08/2009 |
|
Status: Unverified
GOAL:
Sample C Code to get available disk space on Linux.
GOAL:
How to find available disk space on Linux with C code?
FACT(s) (Environment):
Progress/OpenEdge Product Family
FIX:
Using the C code in the note of this solution follow these steps:
1) create a text file, for example getfreespace.c
2) add the C code in the note to the file getfreespace.c
3) compile the C code with make.
Example:
make getfreespace
4) Run the getfreespace binary generated in step 3.
Example:
./getfreespace /usr1
The output should look similar to this:
./getfreespace /usr1
Disk /usr1:
block size: 4096
total no blocks: 17672887
free blocks: 10041989
free non-privileged blocks: 9144258