Previous: Dos Unit Procedures and Functions To the Table of Content Next: DiskFreeKB function

- 4.24.2.1 -
Standard Units
Dos Unit
Dos Unit Procedures and Functions

DiskFree function

Targets: MS-DOS, OS/2, Win32


Dos Unit, WinDos Unit

Returns the number of free bytes on a specified disk drive.

Declaration:
function DiskFree(Drive: Byte): Longint;
Remarks: Drive is the drive to check where A = 1, B = 2, and so on. If Drive is zero then the current drive is used.

DiskFree is useful in determining whether there is enough disk space for disk output. A message can be displayed if there is not enough disk space available.

Example:
uses
  Dos;
begin
  if (DiskFree(0) < 100000) and
      IsFixed(0) then
    begin
      WriteLn('Insufficient Disk Space');
      Halt(1);
    end;
  ...
end.
See also:
DiskFreeKB
DiskSize


Previous: Dos Unit Procedures and Functions To the Table of Content Next: DiskFreeKB function
Dos Unit Procedures and Functions Table of Content DiskFreeKB function

- 4.24.2.1 -