Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rutgers!texbell!vector!attctc!kcdev!pars!cpsolv!rhg From: rhg@cpsolv.UUCP (Richard H. Gumpertz) Newsgroups: comp.unix.questions Subject: How do "df" from within a C program? Message-ID: <470@cpsolv.UUCP> Date: 21 Dec 89 15:31:35 GMT Reply-To: rhg@cpsolv.uucp (Richard H. Gumpertz) Organization: Computer Problem Solving, Leawood, Kansas Lines: 16 I have a C program that would like to take special action when disk space is getting tight for the group of files that it writes (to avoid running out completely). 1) How can a C program get the space available on a file system (i.e., do the equivalent of a "df" command)? 2) How can a C program determine which file system a particular directory is on (so that it can find the appropriate argument for doing the equivalent of "df")? 3) I am using an AT&T Unix PC, OS release 3.51 (roughly Vr2); a system-specific answer will do IF NECESSARY. 4) What are the portability issues of the answers to the above? -- =============================================================================== | Richard H. Gumpertz rhg%cpsolv@uunet.uu.NET -or- ...uunet!amgraf!cpsolv!rhg | | Computer Problem Solving, 8905 Mohawk Lane, Leawood, Kansas 66206-1749 | ===============================================================================