Xref: utzoo comp.unix.wizards:18036 comp.unix.questions:16200 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ncar!unmvax!pprg.unm.edu!topgun.dspo.gov!lanl!cmcl2!dasys1!jpr From: jpr@dasys1.UUCP (Jean-Pierre Radley) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: Finding diskspace status programatically. Keywords: df disk space blocks free Message-ID: <10651@dasys1.UUCP> Date: 6 Sep 89 20:23:10 GMT References: <146@beta.nsc.com> Reply-To: jpr@dasys1.UUCP (Jean-Pierre Radley) Organization: TANGENT Lines: 18 In article <146@beta.nsc.com> somani@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@jpradley.uucp New York, NY 72160.1341@compuserve.com