Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>getfat() get file allocation table information</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getfat()                Get File Allocation Table Information

 #include   <dos.h>

 void           getfat(drive,fatblkp);
 unsigned char  drive;                   Specified drive
 struct fatinfo *fatblkp;                Pointer to structure

    getfat() gets information from the file allocation table for 'drive'.
    The information is stored in the 'fatinfo' structure pointed to by
    'fatblkp'.  'drive' is specified as 0 for the default, 1 for drive A,
    2 for drive B, and so on. The 'fatinfo' structure is defined as:

          struct fatinfo  {
               char fi_sclus;           /* Sectors per cluster */
               char fi_fatid;           /* The FAT id byte */
               int fi_nclus;            /* Number of clusters */
               int fi_bysec;            /* Bytes per sector */
          };

       Returns:     Nothing

   Portability:     MS-DOS only.

   -------------------------------- Example ---------------------------------
    The following statements get the file allocation table information
    for drive A: and reports the number of bytes on the disk.

           #include <stdio.h>
           #include <dos.h>

           main()
           {
               long drivebytes;
               struct fatinfo finfo;

               getfat(1, &finfo);
               drivebytes = finfo.fi_nclus;
               drivebytes *= finfo.fi_sclus;
               drivebytes *= finfo.fi_bysec;
               printf("Drive A: has %ld bytes\n", drivebytes);
           }


See Also: getdfree() getfatd()

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