[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

CheckIfFileIsExecutable

Examines the specified file to see if it is executable

Declaration

Source position: lazfileutils.pas line 48

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 TProcess 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 mesage 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

See also

#fcl.Process.TProcess

The latest version of this document can be found at lazarus-ccr.sourceforge.net.