home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
OS2UTIL.ZIP
/
WFRE.C
< prev
next >
Wrap
Text File
|
1990-05-21
|
1KB
|
47 lines
#define INC_SUB 1
#include "os2.h"
#include "stdio.h"
#include "ctype.h"
#include "stdlib.h"
int main(int argc, char* *argv);
main(argc, argv)
int argc;
char **argv;
{
USHORT usDisk;
ULONG usLogicalDriveMap;
FSALLOCATE FSInfoBuf;
if (argc > 1)
usDisk = toupper(argv[1][0]) - '@';
if (argc == 1 || usDisk < 1 || usDisk > 26)
DosQCurDisk(&usDisk, &usLogicalDriveMap);
printf("\nDrive total bytes bytes used ");
puts("available capacity cluster size");
if (DosQFSInfo(usDisk, 1, (PBYTE) &FSInfoBuf, sizeof(FSInfoBuf))) {
printf(" %c:", usDisk + '@');
puts(" ....Bad Drive Specifier....");
exit(1);
}
else
{
printf(" %c:", usDisk + '@');
printf(" %11lu %10lu ",
FSInfoBuf.cSectorUnit*FSInfoBuf.cUnit*FSInfoBuf.cbSector,
FSInfoBuf.cSectorUnit*(FSInfoBuf.cUnit-FSInfoBuf.cUnitAvail)*FSInfoBuf.cbSector);
printf("%10lu %6.2f%% %4d\n",
FSInfoBuf.cSectorUnit*FSInfoBuf.cUnitAvail*FSInfoBuf.cbSector,
100.0*(FSInfoBuf.cUnit-FSInfoBuf.cUnitAvail)/FSInfoBuf.cUnit,
FSInfoBuf.cSectorUnit*FSInfoBuf.cbSector);
}
return(0);
}