void DetectHDD() /*测试当前磁盘驱动器*/
{
struct dfree diskfree; /*定义结构体变量*/
struct fatinfo fatinfo;
puts("The information of the current disk is :\n"); /*送一字符串到流中,用于显示程序功能*/
getdfree(0,&diskfree); /*获取当前磁盘驱动器信息*/
getfat(0,&fatinfo); /*获取文件分配表信息*/
puts("----------------- hard disk space ------------------"); /*送一字符串到流中,用于对即将显示的*/
/*内容进行说明*/
printf(">>The num of avaible clusters is : %d\n",diskfree.df_avail); /*输出可使用的簇数*/
printf(">>The num of all clusters is : %d\n",diskfree.df_total); /*输出磁盘驱动器的簇数*/
printf(">>The num of bytes of every sector is : %d\n",diskfree.df_bsec); /*输出每个扇区的字节数字节数*/
printf(">>The num of sectors of every cluster is : %d\n",diskfree.df_sclus); /*输出每个簇的扇区数*/
puts("----------- file allocation table -------------"); /*送一字符串到流中,用于对即将显示的*/
printf(">>The num of sectors of every cluster is : %d\n",fatinfo.fi_sclus); /*输出每个簇扇区数*/
printf(">>The num of bytes of file allocation table is : %d\n",fatinfo.fi_fatid); /*文件分配表字节数*/
printf(">>The num of clusters is : %d\n",fatinfo.fi_nclus); /*簇的数目*/
printf(">>The num of ytes of every sector is : %d\n",fatinfo.fi_bysec); /*每个扇区字节数*/
}