-
Declaration:
- Function AddDisk (Const PAth : String) : Longint;
-
Description:
- On Linux both the DiskFree (80) and DiskSize (81) 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 (735), DiskSize (736)
-
Declaration:
- Function CreateDir(Const NewDir : String) : Boolean;
-
Description:
- CreateDir creates a new directory with name NewDir. If the directory doesn’t contain an
absolute path, then the directory is created below the current working directory.
The function returns True if the directory was successfully created, False otherwise.
-
Errors:
- In case of an error, the function returns False.
-
See also:
- RemoveDir (737)
Listing: sysutex/ex26.pp
-
Declaration:
- Function DiskFree(Drive : Byte) : Int64;
-
Description:
- DiskFree returns the free space (in bytes) on disk Drive. Drive is the number of the disk
drive:
-
0
- for the current drive.
-
1
- for the first floppy drive.
-
2
- for the second floppy drive.
-
3
- for the first hard-disk parttion.
-
4-26
- for all other drives and partitions.
Remark Under LINUX, and Unix in general, the concept of disk is different than the DOS one, since
the filesystem is seen as one big directory tree. For this reason, the DiskFree and DiskSize (81)
functions must be mimicked using filenames that reside on the partitions. For more information,
see AddDisk (734)
-
Errors:
- On error, -1 is returned.
-
See also:
- DiskSize (736), AddDisk (734)
Listing: sysutex/ex27.pp
-
Declaration:
- Function DiskSize(Drive : Byte) : Int64;
-
Description:
- DiskSize returns the size (in bytes) of disk Drive. Drive is the number of the disk
drive:
-
0
- for the current drive.
-
1
- for the first floppy drive.
-
2
- for the second floppy drive.
-
3
- for the first hard-disk parttion.
-
4-26
- for all other drives and partitions.
Remark Under LINUX, and Unix in general, the concept of disk is different than the DOS one, since
the filesystem is seen as one big directory tree. For this reason, the DiskFree (80) and DiskSize
functions must be mimicked using filenames that reside on the partitions. For more information,
see AddDisk (734)
-
Errors:
- On error, -1 is returned.
-
See also:
- DiskFree (735), AddDisk (734)
For an example, see DiskFree (735).
-
Declaration:
- Function GetCurrentDir : String;
-
Description:
- GetCurrentDir returns the current working directory.
-
Errors:
- None.
-
See also:
- SetCurrentDir (737), DiskFree (80), DiskSize (81)
Listing: sysutex/ex28.pp
-
Declaration:
- Function RemoveDir(Const Dir : String) : Boolean;
-
Description:
- RemoveDir removes directory Dir from the disk. If the directory is not absolue, it is
appended to the current working directory.
-
Errors:
- In case of error (e.g. the directory isn’t empty) the function returns False. If successful,
True is returned.
-
See also:
For an example, see CreateDir (734).
-
Declaration:
- Function SetCurrentDir(Const NewDir : String) : Boolean;
-
Description:
- SetCurrentDir sets the current working directory of your program to NewDir. It returns
True if the function was successfull, False otherwise.
-
Errors:
- In case of error, False is returned.
-
See also:
- GetCurrentDir (737)
Listing: sysutex/ex29.pp