CheckIfFileIsExecutable procedure
Examines the specified file to see if it is executable.
Declaration
procedure CheckIfFileIsExecutable(const AFilename: string)Arguments
AFilename | File name to examine. |
Description
CheckIfFileIsExecutable is a procedure used to examine the
specified file name to see if it is executable. CheckIfFileIsExecutable is
implemented for UNIX-like environments, and allows a process to better
determine if the file can be executed on the platform or OS, and to get
better error messages when it cannot.
CheckIfFileIsExecutable raises an exception with a specific message when the platform or OS facilities indicate it is necessary.
Use FileIsExecutable to determine of a file is executable without raising an exception.
Errors
The Exception contains the following messages (from string resources):
- lrsFileDoesNotExist
- Raised when FileExistsUTF8 returns False
- lrsFileIsADirectoryAndNotAnExecutable
- Raised when DirPathExists indicates the file is actually a directory name
- lrsReadAccessDeniedFor
- Raised when fpGetErrno() returns ESysEAcces
- lrsADirectoryComponentInDoesNotExistOrIsADanglingSyml
- Raised when fpGetErrno() returns ESysENoEnt
- lrsADirectoryComponentInIsNotADirectory
- Raised when fpGetErrno() returns ESysENotDir
- lrsInsufficientMemory
- Raised when fpGetErrno() returns ESysENoMem
- lrsHasACircularSymbolicLink
- Raised when fpGetErrno() returns ESysELoop
- lrsIsNotExecutable
- Raised when fpGetErrno() has a value other than the above
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
