prev up next   top/contents search

comp.lang.c FAQ list · Question 19.19

Q: How can I find out how much free space is available on disk?


A: There is no portable way. Under some versions of Unix you can call statfs. Under MS-DOS, use interrupt 0x21 subfunction 0x36, or perhaps a routine such as diskfree. Another possibility is to use popen (see question 19.30) to invoke and read the output of a ``disk free'' command (df on Unix).

(Note that the amount of free space apparently available on a disk may not match the size of the largest file you can store, for all sorts of reasons.)


prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North