help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'sysutils' (#rtl)

AddDisk

Add a disk to the list of known disks (Unix only)

Declaration

Source position: sysutils.pp line 41

function AddDisk(

  const path: String

):Byte;

Description

On Linux both the DiskFree and DiskSize functions need a file on the specified drive, since is required for the statfs system call.

These filenames are set in drivestr[0..26], and the first 4 have been preset to :

Disk 0
'.' default drive - hence current directory is used.
Disk 1
'/fd0/.' floppy drive 1.
Disk 2
'/fd1/.' floppy drive 2.
Disk 3
'/'C: equivalent of DOS is the root partition.

Drives 4..26 can be set by your own applications with the AddDisk call.

The AddDisk call adds Path to the names of drive files, and returns the number of the disk that corresponds to this drive. If you add more than 21 drives, the count is wrapped to 4.

Errors

None.

See also

DiskFree

  

Return the amount of free diskspace

DiskSize

  

Return the total amount of diskspace.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505