Finding diskspace status programatically.

Jean-Pierre Radley jpr at dasys1.UUCP
Thu Sep 7 06:23:10 AEST 1989


In article <146 at beta.nsc.com> somani at parns.nsc.com (Anil Somani) writes:
>What is the best way to find out current available diskspace 
>from within a program? One way is -
>             system("df . > /tmp/somename");


Have you tried the ustat() call?
It uses the ustat structure which looks like this:

struct  ustat {
	daddr_t	f_tfree;	/* total free blocks */
	ino_t	f_tinode;	/* total inodes free */
	char	f_fname[6];	/* filsys name */
	char	f_fpack[6];	/* filsys pack name */
};
-- 
Jean-Pierre Radley					      jpr at jpradley.uucp
New York, NY					      72160.1341 at compuserve.com



More information about the Comp.unix.questions mailing list