| www.delorie.com/djgpp/doc/libc-2.01/libc_136.html | search |
_dos_getdiskfree@donoderef()
Syntax
#include <dos.h> unsigned int _dos_getdiskfree(unsigned int drive, struct diskfree_t *diskspace);
This function determines the free space on drive drive (0=default, 1=A:, 2=B:, etc.) and fills diskspace structure.
Returns with 0 if successful and non-zero on error (sets errno=EINVAL).
struct diskfree_t df;
unsigned long freebytes;
if ( !_dos_getdiskfree(0, &df) )
{
freebytes = (unsigned long)df.avail_clusters *
(unsigned long)df.bytes_per_sector *
(unsigned long)df.sectors_per_cluster;
printf("There is %lu free bytes on the current drive.\n", freebytes);
}
else
printf("Unable to get free disk space.\n");
Go to the first, previous, next, last section, table of contents.
| prev next webmaster | delorie software privacy |
| Copyright © 1997 | Updated Apr 1997 |