Previous: 4.74.2.2. DiskFree function To the Table of Contents Next: 4.74.2.4. DiskSize function
4.74.2.2. DiskFree function Table of Contents 4.74.2.4. DiskSize function

- 4.74.2.3. -
Table of Contents
4. Standard Units
4.74. WinDos - MS-DOS function emulation for OS/2 and Win32
4.74.2. WinDos Unit Procedures and Functions
4.74.2.3. DiskFreeKB function


4.74.2.3. DiskFreeKB function

Targets: MS-DOS, OS/2, Win32


Dos Unit, WinDos Unit

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

Declaration:
function DiskFreeKB(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 (DiskFreeKB(0) < 100) and
      IsFixed(0) then
    begin
      WriteLn('Insufficient Disk Space');
      Halt(1);
    end;
   ...
end.
See also:
DiskFree
DiskSize


Previous: 4.74.2.2. DiskFree function To the Table of Contents Next: 4.74.2.4. DiskSize function
4.74.2.2. DiskFree function Table of Contents 4.74.2.4. DiskSize function

- 4.74.2.3. -