This source code is for Borland Delphi (Object Pascal), it should load and compile cleanly in most versions of the IDE. It was written using the Borland IDE, and tested numerous times in production programs of both my own and others. If you use any of this and find a bug, or just want to tell me it was useful, please contact me to tell me about it.
Relevant Links
Disk and File Functions
A unit of disk and file functions, somewhat dated but useful. If you need to delete, create, manipulate or otherwise edit files and folders, this is a handy unit.
What functions are in it?
Functions implemented in this unit:
- fstrWinFolder: retrieve the folder that the current version of Windows is installed to.
- fboolIsNT: is the app currently running on WindowsNT (true/false).
- fcompTotalDriveSpace: size of current hard drive.
- fcompFreeDriveSpace: free space of current hard drive.
- fintDriveNum: get the drive number associated with a drive letter.
- fstrAddSlash: add a backslash to a path if necessary.v
- fboolDirectoryExists: returns true if a folder exists.v
- fboolCreateDir: create a folder.v
- fstrGetFileExpandedName: get the full name of a compressed file (when compressed by compress.exe using the -r function).
- flngFileExpand: expand a compressed file (when it was compressed using MS compress.exe)v
- fintFileCopy: copy a source to a destination file
- flngRecurseDrive: recurse all specified files into a string list
- fstrBrowseFolder: call up the browse-for-folder dialogv
- fdatGetFileDate: get the date of a file
- flngGetFileSize: get the size of a file
- flngGetDriveType: get the type of drive, given the root path to the drive
- fstrGetFileAttributes: get the attributes of a specified filev
- fboolIsFileReadOnly: returns true if the file is read only
- fboolFileSetAttributes: set the attributes of a file
- fboolIsDriveReady: check on whether a drive is ready to be accessed
- fdwdVolumeSerialNumber: get the drive serial number
- fstrVolumeName: get the drive label (volume name)
- fstrFileSystemName: get the current file system name on a drive
- fboolDriveCaseSensitive: returns true if the current file system is case sensitive
- fboolDriveCasePreserve: returns true if the current file system preserves case
- fboolDriveCompressed: returns true if the drive is compressedv
- flngListAllDrives: get a list of all logical drives, put into a string list
- fboolExploreFolder: open an explorer window on a given folderv
- fboolDeleteFile: delete a file
- fboolCheckRename: check for the [rename] section of wininit.ini, insert if necessary
- fboolMoveFileOnBoot: move a file on the next reboot/startup
- fboolDeleteFileOnBoot: delete a file on the next reboot/startup
- fboolGetFileVersion: get a file version number
