Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>_dos_getdiskfree</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_dos_getdiskfree
================

`_dos_getdiskfree'
==================

Syntax
------

     #include <dos.h>
     
     unsigned int _dos_getdiskfree(unsigned int drive, struct diskfree_t *diskspace);

Description
-----------

This function determines the free space on DRIVE drive (0=default,
1=A:, 2=B:, etc.) and fills DISKSPACE structure.

Return Value
------------

Returns with 0 if successful and non-zero on error (sets ERRNO=EINVAL).

Example
-------

     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");


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson