getfat

getfat

getfat功 getfat(in fatin

函數名


getfat

功 能


取文件分配表信息

用 法


void getfat(int drive, struct fatinfo *fatblkp);

程序例


#include
#include
int main(void)
{
struct fatinfo diskinfo;
int flag = 0;
printf("Please insert disk in drive A\n");
getchar();
getfat(1, &diskinfo);
printf("\nDrive A: is ");
switch((unsigned char) diskinfo.fi_fatid)
{
case 0xFD:
printf("360K low density\n");
break;
case 0xF9:
printf("1.2 Meg high density\n");
break;
default:
printf("unformatted\n");
flag = 1;
}
if (!flag)
{
printf(" sectors per cluster %5d\n",
diskinfo.fi_sclus);
printf(" number of clusters %5d\n",
diskinfo.fi_nclus);
printf(" bytes per sector %5d\n",
diskinfo.fi_bysec);
}
return 0;
}