Files
harbour-core/tests/diskspac.prg
Viktor Szakats 3ed9fa0f45 2016-01-14 19:33 UTC+0100 Viktor Szakats (vszakats users.noreply.github.com)
* *
    % remove brandings and homepage from copyright header. Pass 2 - semi-auto.
    * project homepage and name is described in README, amongst others
    ; this should make the diff between 3.4 and 3.2 easier to manage
2016-01-14 19:35:07 +01:00

32 lines
1.1 KiB
Plaintext

/*
This program demonstrates that the 4 diskspace related functions work
correctly for disks of any size.
Certain os's may allow limits to the amount of disk space available to
a user. If that is the case, you should see a difference between
the return value of DiskSpace() and DiskFree().
Currently, Disk quota's are only implimented for NT.
NOTE: Unlike Clipper, these functions return a floating point number!
Written by Paul Tucker {ptucker@sympatico.ca>
This test program placed in the public domain
*/
#include "fileio.ch"
PROCEDURE Main( cDisk )
IF Empty( cDisk )
cDisk := hb_DirBase() + hb_ps()
ENDIF
? "Bytes available on disk: " + Transform( hb_DiskSpace( cDisk, HB_DISK_FREE ), "999,999,999,999" )
? "Bytes available for use: " + Transform( hb_DiskSpace( cDisk, HB_DISK_AVAIL ), "999,999,999,999" )
? " Bytes used: " + Transform( hb_DiskSpace( cDisk, HB_DISK_USED ), "999,999,999,999" )
? " Total bytes at " + cDisk + ": " + Transform( hb_DiskSpace( cDisk, HB_DISK_TOTAL ), "999,999,999,999" )
RETURN