home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
264_01
/
df.c
< prev
next >
Wrap
Text File
|
1979-12-31
|
640b
|
36 lines
/*
* df - display bytes free on disk
* Usage: df [d]
*
* David MacKenzie
* Latest revision: 04/22/88
*/
main(argc, argv)
int argc;
char **argv;
{
long disk_bytes_free();
long dbf;
switch (argc) {
case 1:
dbf = disk_bytes_free(0);
break;
case 2:
dbf = disk_bytes_free(argv[1][0]);
break;
default:
printf("Usage: df [d]\n");
exit(1);
}
if (dbf == -1) {
printf("Bad drive\n");
exit(1);
} else {
printf("%ld bytes free\n", dbf);
exit(0);
}
}