Try Something like this…
-Paul
GLOBAL LONG glfmsl_DiskFreeSpace( LONG lMinBlocks )
{
long lFree, lTotal; /* Using long not LONG as this is what disk_space()
requires */
LONG lReturn;
int iFd;
/* Access Disk (Read of always existing Root Directory: /. ) */
iFd = open ( “/.”, O_RDONLY );
if ( 0 > iFd )
{
/puts (“glfmsl_DiskFreeSpace(): Notify DS: Could Not Open File”);/
return ( GLE_RC_DISK_ACCESS );
}
lReturn = disk_space ( iFd, &lFree, &lTotal );
close ( iFd );
if ( 0 != lReturn )
{
/puts (“glfmsl_DiskFreeSpace(): Notify DS: Error Checking Disk Space”);/
return ( GLE_RC_DISK_ACCESS );
}
/* Sufficient Disk Space Available? */
if ( lFree >= lMinBlocks )
{
/printf(“Sufficient Space Free: %d %xh \n”, lFree, lFree );/
return ( lFree );
}
return ( GLE_RC_DISK_LOW );
}
Tomas Hogstrom <tomho@my-deja.com> wrote in message
news:8pq749$6gb$1@nnrp1.deja.com…
I’d like to read the used and remaining disk space for a
file system from an application, i.e. do what df does.
How do I do that? I haven’t found any suitable calls.
Cheers / Tomas Hogstrom
Sent via Deja.com > http://www.deja.com/
Before you buy.