Hi All,
I am trying to write a C program to calculate the Unix FILE System Size and Free Size available in Unix
i am not able to finish program..
is it anyone have any idea or any thought.
please share with me.
Thanks in Advance,
Anwar
Hi All,
I am trying to write a C program to calculate the Unix FILE System Size and Free Size available in Unix
i am not able to finish program..
is it anyone have any idea or any thought.
please share with me.
Thanks in Advance,
Anwar
file size is pretty easy -- use stat() function. Don't know about getting amount of free disk space.
Hi
THanks for response. i have tried with stat and fstat also.
but basically my req. is like that
i want to know the following directory
free space and size of the directory sturcture
for example output should be like that
i mean user input is directory path or name
and out put is
directroy - /countrys/rakeshs/download -
free size - 2325345456
total space - 344354567
pls let me know how will proceed.
coz fstat will calcuate only file size.
regards,
Anwar
to get the sum of the file sizes in a directory, call opendir() and readdir(). Call fstat() or stat() for each filename retrieved by readdir. see man pages or google for info about those functions.
Hi
Thanks for reply.But i want total size of directory.
i mean free space size also.
is it any way to calculate that.
Thanks
ANwar
I don't think you can set the max size of a directory. I know you can set the max disk space that any user can use, but I don't think it can be done by directory.
the freespace of a directory is the freespace of the filesystem it sits on (normally) unless you use a quota system (something I haven't delt with myself yet).
If any part of my post is incorrect, please correct me.
This post is not guarantied to be correct, and is not to be taken as a matter of fact, but of opinion or a guess, unless otherwise noted.