Usando xHarbour 1.2.3 com Borland 7.3
A Sintax da função é:
- DiskSpace( [<nDrive>], [<nType>] ) --> nBytes
As contants são:
- HB_DISK_AVAIL *) = 0 - Free disk space avialable to the application -
- HB_DISK_FREE = 1 - Total free disk space
- HB_DISK_USED = 2 - Used disk space
- HB_DISK_TOTAL = 3 - Total disk space
Exemplo:
Código: Selecionar todos
// The example lists two disk storage types for all drives taking
// advantage of the runtime error created for unaccessible drives.
#include "Fileio.ch"
PROCEDURE Main
LOCAL i, bError := ErrorBlock( {|e| Break(e) } )
FOR i:=1 TO 26
BEGIN SEQUENCE
? "Drive",Chr(64+i)+":", DiskSpace( i, HB_DISK_FREE ), ;
DiskSpace( i, HB_DISK_TOTAL)
RECOVER
?"Drive",Chr(64+i)+":", "not ready or not existent"
END SEQUENCE
NEXT
ErrorBlock( bError )
RETURN


