Path: utzoo!mnetor!uunet!apctrc!zjat02 From: zjat02@apctrc.UUCP (Jon A. Tankersley) Newsgroups: comp.unix.questions Subject: Re: checking disk space from c program Message-ID: <474@apctrc.UUCP> Date: 10 Apr 88 04:18:45 GMT References: <398@wpg.UUCP> Reply-To: zjat02@apctrc.UUCP (Jon A. Tankersley) Organization: Amoco Production Co, Tulsa Research Center Lines: 23 On a Sun maybe on any BSD system - statfs has the information. Here is a skeleton: #include #include . . . struct statfs buf; /* * call statfs regarding a filename path and check out the results * filename MUST exist as either file or directory */ if ( statfs(path,&buf) == 0 ) /* return block_size*blocks_avail as size in bytes */ return(buf.f_bsize*buf.f_bavail); else /* error, return -1 */ return(-1); -tank-