O/S Access

Get_File_Details

Retrieves the size and last update time (UTC) of a file on disk.
Function Get_File_Details(CONST FileName: String; VAR Size_In_Bytes: Int64; VAR Last_Update_UTC: TDateTime): Boolean;

Parameters

  • FileName: String; the full path to the file.
  • Size_In_Bytes: Int64; output parameter that receives the file size in bytes.
  • Last_Update_UTC: TDateTime; output parameter that receives the file's last modification time in UTC.

Return Value

Returns True if the file exists and details were successfully retrieved.
Returns False if the file is not accessible or not found.

File_Exists

Checks whether a file exists and optionally meets a minimum size requirement.
Function File_Exists(CONST FileName: String; CONST Minimal_Size_In_Bytes: Int64 = 3): Boolean;

Parameters

  • FileName: String; the full path to the file.
  • Minimal_Size_In_Bytes: Int64; minimum file size required to consider it valid (default is 3).

Return Value

Returns True if the file exists and meets the size requirement.
Returns False otherwise.

Directory_Exists

Checks if a directory exists on disk.
Function Directory_Exists(Directory: String): Boolean;

Parameters

  • Directory: String; the path of the directory to check.

Return Value

Returns True if the directory exists.
Returns False if it does not.

Delete_File

Attempts to delete a file, with optional retry attempts.
Function Delete_File(FileName: String; Tryout_Loops: Integer = 1): Boolean;

Parameters

  • FileName: String; full path of the file to delete.
  • Tryout_Loops: Integer; number of attempts to try deleting the file (default is 1).

Return Value

Returns True if the file was successfully deleted.
Returns False otherwise.

Rename_File

Renames a file with optional retry attempts if the first attempt fails.
Function Rename_File(OldName, NewName: String; Tryout_Loops: Integer = 1): Boolean;

Parameters

  • OldName: String; the original filename including path.
  • NewName: String; the desired new filename including path.
  • Tryout_Loops: Integer; number of retry attempts if the rename fails (default is 1).

Return Value

Returns True if the rename operation was successful.
Returns False otherwise.

Rename_Folder

Renames a folder using wide string names for Unicode compatibility.
Function Rename_Folder(OldName, NewName: WideString): Boolean;

Parameters

  • OldName: WideString; the current full path of the folder.
  • NewName: WideString; the new full path for the folder.

Return Value

Returns True if the folder was successfully renamed.
Returns False if the operation failed.

Make_File_Readonly

Marks a file as read-only using Windows attributes.
Function Make_File_Readonly(FileName: String): Boolean;

Parameters

  • FileName: String; the full path to the file.

Return Value

Returns True if the attribute was successfully set.
Returns False if the operation failed.

Copy_File

Copies a single file to a new location with optional time and speed behavior.
Function Copy_File(Source, Target: String; CopySourceFileTime: Boolean; SlowerCopy: Boolean = False): Boolean;

Parameters

  • Source: String; path of the file to copy.
  • Target: String; destination path of the copied file.
  • CopySourceFileTime: Boolean; if True, preserves the original file's timestamp.
  • SlowerCopy: Boolean; if True, uses a slower copy method for compatibility (default is False).

Return Value

Returns True if the copy succeeded.
Returns False otherwise.

Copy_Files

Copies multiple files from a source folder to a target folder using a file mask.
Function Copy_Files(SourcePath, TargetPath, FileMask: String; CopySourceFileTime, SlowerCopy: Boolean): Boolean;

Parameters

  • SourcePath: String; the folder to copy files from.
  • TargetPath: String; the destination folder.
  • FileMask: String; pattern for selecting files (e.g. *.txt).
  • CopySourceFileTime: Boolean; if True, preserves timestamps.
  • SlowerCopy: Boolean; if True, uses a slower copy algorithm for compatibility.

Return Value

Returns True if all matching files were copied successfully.
Returns False if any file fails to copy.

Force_Directories

Creates all parent directories for the specified path if they do not exist.
Function Force_Directories(Dir: String): Boolean;

Parameters

  • Dir: String; the full path to create.

Return Value

Returns True if the path exists or was successfully created.
Returns False on failure.

Kill_Files

Deletes all files matching a mask in the given folder.
Procedure Kill_Files(Path, FileMask: String);

Parameters

  • Path: String; the directory to scan for files.
  • FileMask: String; the file pattern to delete (e.g. *.tmp).

Kill_Directory

Deletes a folder and all of its contents recursively.
Procedure Kill_Directory(Path: String);

Parameters

  • Path: String; the directory to delete.

_TrueType_Fonts_List

Returns a list of installed TrueType font names on the system.
Function _TrueType_Fonts_List: String;

Return Value

Returns a string containing the names of TrueType fonts, separated by line breaks.