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

/*
  diskinfo.c (C) 2000 Michele Andreoli, for muLinux
  output:  diskinfo=current-disk,disk-label,
		current-dir,disk-size K,disk-free K

*/




char disks[40]="ABCDEFGHIJLMNOPQRSTUVWXYZ";
char buf[1024];
double sclus;
int cdisk;
double tot,avail;

main()
{
struct dfree df;
cdisk=getdisk();
getdfree(0,&df);
sclus=(double)df.df_sclus;
getcurdir(0,buf);

tot=sclus*512*df.df_total;
avail=sclus*512*df.df_avail;

printf ("diskinfo=%d,%c,%s,%.0f,%.0f\n",cdisk,disks[cdisk], buf,
		tot/1024,avail/1024);
}
