diff --git a/docs/xml/lcl/fileutil.xml b/docs/xml/lcl/fileutil.xml index 8013958515..4d0c415d33 100644 --- a/docs/xml/lcl/fileutil.xml +++ b/docs/xml/lcl/fileutil.xml @@ -217,18 +217,24 @@ - - - - + + FileIsExecutable - checks if + AFileName refers to an executable file + +

+ FileIsExecutable - checks if + AFileName refers to an executable file

+

On Windows systems, if the file exists it is regarded as executable.

+

On other systems (eg Unix etc), looks at file permissions to see whether execute flag is set

+
- + Returns True if file is executable (always true in Windows if file exists) - + Name of the file for checking @@ -263,18 +269,21 @@ - - - - + + GetFileDescription - finds the Unix-type file description for the given file + +

+ GetFileDescription - finds the Unix-type file description for the given file

+

No action in Windows systems (returns empty string)

+
- + Returns empty string (Windows) or Unix-type file description string in other systems - + The name of the file whose description is sought @@ -309,37 +318,35 @@ - - - - + + ForceDirectory - creates a directory if none exists - + Returns True if successfully created directory - + The name of the directory required - - - - + + DeleteDirectory - Delete the named directory (or only its contents if + OnlyChilds is True) + If there was an error, such as trying to removing . or .., or there were insufficient permissions, or the file did not exist, False is returned - + Returns True if the directory or its contents were correctly removed - + The name of the directory for processing - + If True, only the contents ('children') of the directory are removed @@ -354,18 +361,22 @@ - - - - + + DirectoryIsWritable - checks if it is possible to write a file to the named directory + +

+ DirectoryIsWritable - checks if it is possible to write a file to the named directory

+

Tries to create a text file within the named directory, and write to it. Returns True if it works, and False if it doesn't. Also raises an Exception on failure

+
+ An Exception is raised on failure to create or write to the temporary file
- + Returns True if successful in writing a temporary file to the named directory - + Name of the Directory for checking @@ -375,18 +386,16 @@ - - - - + + ExtractFileNameOnly - removes all path delimiters and file extensions, leaving just the file name - + Returns the original file name with path delimiters and the extension removed - + The name of the file for processing @@ -425,9 +434,11 @@ CaseSensitive - if True, case of + Ext must match case in + FileName @@ -495,50 +506,51 @@ - - - - + + CleanAndExpandFilename - trims irrelevant characters such as path delimiters from the name of the file - + Returns the original file name without redundant leading or trailing spaces, path delimiters etc - + The name of the file for processing - - - - + + CleanAndExpandDirectory - trims and cleans + FileName and appends a directory delimiter to it - + Returns the cleaned file name with appended directory delimiter - + The name of the file for operation CreateAbsoluteSearchPath - concatenates + BaseDirectory and + SearchPath to form an absolute path to search for files

CreateAbsoluteSearchPath - concatenates + BaseDirectory and + SearchPath to form an absolute path to search for files

Adds appropriate path delimiters to the BaseDirectory string, then adds the search path, checking that each directory in the path is in fact an absolutely specified directory, then returns the fully formed absolute search path.

@@ -568,11 +580,13 @@ CreateRelativePath - given an absolute path and a + BaseDirectory, create a search path relative to the current directory

CreateRelativePath - given an absolute path and a + BaseDirectory, create a search path relative to the current directory

The returned string includes the correct number of dots and double dots to signify relativity to the current directory (eg ../../or ..\..\ etc)

@@ -594,41 +608,51 @@
- - - - + + FileIsInPath - checks that + FileName refers to a file that exists within the given + Path + - + Returns True if a file named Filename exists within the given Path + - + The name of the file for checking - + The Path to be searched - - - - + + FileIsInDirectory - checks whether a file with + FileName exists within the given + Directory + + +

+ FileIsInDirectory - checks whether a file with + FileName exists within the given + Directory +

+
- + Returns True if the file is in the directory - + The name of the file to be checked - + The name of the directory to be searched for the file @@ -672,14 +696,12 @@ - - - - + + GetExeExt - find the correct extension for an executable file - + Returns '.exe' in Windows, nothing in other systems @@ -745,48 +767,55 @@ - - - - + + FindDiskFilename - finds the file that best fits the supplied filename + +

+ FindDiskFilename - finds the file that best fits the supplied filename

+

Searches for the filename case on disk. The file must exist.

+

For example: If Filename='file' and there is only a 'File' then 'File' will be returned.

+
- + Returns the best fitting filename from the disk (taking case into consideration) - + The name of the file for checking - - - - + + FindDiskFileCaseInsensitive - searches for the given + FileName in a case insensitive manner - + If it exists, returns the file name with path information otherwise returns an empty string - + The name of the file for processing - - - - + + FindDefaultExecutablePath - finds the default path to the named Executable file + +

+ FindDefaultExecutablePath - finds the default path to the named Executable file

+

On Windows systems, looks for the '.EXE' extension

+

In all systems, searches the 'PATH' environment variable to see if the file is in one of the default paths

+
- + Returns the filename of the Executable file with path information attached - + The name of the Executable file @@ -1053,22 +1082,25 @@ - - - - + + GetTempFilename - finds a suitable name for a temporary file + +

+ GetTempFilename - finds a suitable name for a temporary file

+ Uses Prefix plus an integer to generate a file with extension '.tmp' in the specified Directory; if it already exists, increments the integer until it finds a name that is not already used +
- + Returns the temporary file name that has been created - + The Directory in which the temprary file is to be placed - + The Prefix to which an integer will be attached to generate a temporary filename