Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function DiskFree(Drive: Byte): Int64;
Returns the amount of free space in bytes on a specified drive.
DiskFree returns -1 if the drive number is invalid. Drive parameter can be set to: 0 = Current drive, 1 = A, 2 = B, 3 = C and so on.
//displays a message indicating the number
//of KB free, and what percentage of
//the entire disk space that represents.
var
S: string;
AmtFree: Int64;
Total: Int64;
begin
AmtFree := DiskFree(0);
Total := DiskSize(0);
S := IntToStr(AmtFree div Total) +
'percent of the space on drive 0 is free: ' +
(AmtFree div 1024) + ' Kbytes free. ';
ShowMessage(S);
end;
|
Deleting group of files
The code example demonstrates using the SHFileOperation function to copy a group of files and display a progress dialog. You can also use the following flags to delete, move and rename a group of files.
DiskSize
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|