checking disk space from c program

Juergen Wagner gandalf at csli.STANFORD.EDU
Mon Apr 11 14:49:54 AEST 1988


In article <71 at kenobi.UUCP> ford at kenobi.UUCP (Mike Ditto) writes:
>...
>Read /etc/mnttab to see what devices are mounted, and use the ustat
>system call to check the status of each.  Or, if you are wondering how
>big you can make a certain file, you can also stat() the file (or the
>directory in which you intend to create it) to see what device it is
>on, and ustat() that.
>...

The problem with ustat is that it doesn't exist on BSD systems (even on
Suns), and the problem with stat is that you can't get the whole 
information without actually reading the super-block, i.e. without having
root privileges. Normal users have to stick with "df" pipes thru some
filter.

Juergen "Gandalf" Wagner,		   gandalf at csli.stanford.edu
Center for the Study of Language and Information (CSLI), Stanford CA

Disclaimer: The opinions expressed herein are those of my cat.
-- 
Juergen "Gandalf" Wagner,		   gandalf at csli.stanford.edu
Center for the Study of Language and Information (CSLI), Stanford CA



More information about the Comp.unix.questions mailing list