Sign in Join
FPDoc Onlineexperiment

LazFileUtils unit

Contains types, procedures, and functions used for file and directory operations.

lazfileutils.pas contains types, procedures, and functions used for file and directory operations. lazfileutils.pas is part of the LazUtils package.

All functions are thread-safe unless explicitly stated.

Classes and records

TRawbyteSearchRecHelperhelperRecord Helper for the TRawbyteSearchRecHelper record type.
TUnicodeSearchRecHelperhelperRecord Helper for the TUnicodeSearchRec record type.

Procedures and functions

AppendPathDelimfunctionAdds a trailing path delimiter to the specified path (when needed).
CheckIfFileIsExecutableprocedureExamines the specified file to see if it is executable.
CheckIfFileIsSymlinkprocedureChecks whether the specified file name is a symbolic link on the local file system.
CheckPathDelimfunctionDetermines if the specified path delimiter character is not used on the system.
ChompPathDelimfunctionRemoves a trailing path delimiter from the specified value.
CleanAndExpandDirectoryfunctionRemoves whitespace and resolves special characters in the specified path.
CleanAndExpandFilenamefunctionRemoves whitespace and resolves special characters in the specified file name.
CompareFileExtfunctionCompares the extension in a file name to a given value and returns the relative order.
CompareFilenamesfunctionGets the relative sort order for the specified file names.
CompareFilenamesIgnoreCasefunctionGets the relative sort order for case-insensitive file names.
CompareFilenamesPfunctionCompares file names to determine their relative sort order.
CompareFilenameStartsfunctionCompares file names using the number characters in common.
CreateAbsolutePathfunctionReturns an absolute path relative to the specified base directory (when needed).
CreateAbsoluteSearchPathfunctionConcatenates BaseDirectory and SearchPath to form an absolute path to search for files.
CreateDirUTF8functionCreates a new directory with the specified name.
CreateRelativePathfunctionGets the relative path from BaseDirectory to Filename.
CreateRelativeSearchPathfunctionResolves relative path value(s) in the specified search path.
DbgSFileAttrfunctionGenerates a debugger message with information about the specified file attributes.
DeleteFileUTF8functionDeletes the specified file name.
DirectoryExistsUTF8functionDetermine if the specified path exists on the local file system.
DirectoryIsWritablefunctionIndicates if the specified directory name is writable.
DirPathExistsfunctionIndicates if the specified directory name exists on the local file system.
ExpandFileNameUTF8functionExpands the values in FileName and BaseDir to an absolute file name.
ExtractFileNameOnlyfunctionGets the base file name (without the file extension) in the specified path.
ExtractFileNameWithoutExtfunctionGets the value from AFilename prior to the '.' character that starts the file extension.
ExtractFileRootfunctionGets the root drive/path/directory for the specified file name.
ExtractUNCVolumefunctionGets UNC host and volume name used in the specified path.
FileAgeUTF8functionReturns the last modification time for the file as an Int64 value.
FileCreateUTF8functionCreates the specified file and returns its file handle.
FileExistsTreatPackageAsFilefunction
FileExistsUTF8functionIndicates if the specified UTF-8-encoded file name exists.
FileGetAttrUTF8functionGets the value of file attributes for the specified file name.
FileIsExecutablefunctionDetermines if the specified file name is executable.
FileIsHardLinkfunctionIndicates if the specified file has a descriptor or handle on the local file system.
FileIsInPathfunctionReturns True if Filename exists in the specified Path.
FileIsReadablefunctionIndicates if the specified file name is readable.
FileIsReadOnlyUTF8functionDetermines if the specified file is marked as read-only.
FileIsSymlinkfunctionIndicates if the specified file is a symbolic link in the file system.
FileIsTextfunctionDetermines if the specified file contains plain text content.
FileIsWritablefunctionIndicates if the specified file name is writable.
FilenameExtInfunctionDetermines if the file name uses one of the specified file extensions.
FilenameExtIsfunctionDetermines if Filename has the specified file extension.
FilenameIsAbsolutefunctionDetermines if the specified value is an absolute file path (not a relative one).
FilenameIsTrimmedfunctionTrue if the specified file name contains characters to remove or resolve before use.
FilenameIsUnixAbsolutefunctionDetermines if the specified value is an absolute file path (not a relative one).
FilenameIsWinAbsolutefunctionDetermines if the specified value is an absolute file path (not a relative one).
FileOpenUTF8functionOpens the specified file name and returns its file handle.
FileSearchUTF8functionSearches for a file with the specified name in the list of directory paths.
FileSetAttrUTF8functionSets the file attribute value for the specified file name.
FileSetDateUTF8functionSets the last modification time for the file.
FileSizeUtf8functionGets the size for the specified file name.
FindCloseUTF8procedureFrees resources allocated to the specified search record.
FindFirstUTF8functionStarts searching for files matching the specified path value.
FindNextUTF8functionLocates another file matching the search criteria.
FindPathInSearchPathfunctionLocates the specified path in a delimited list of search paths.
ForceDirectoriesUTF8functionCreates the directories specified in Dir if they do not already exist.
ForceDirectoryfunctionCreates the specified directory if it does not already exist.
ForcePathDelimsprocedureEnsures that path delimiters in the specified file name are correct for the current platform or OS.
GetAppConfigDirUTF8functionGets the directory for application configuration and data files.
GetAppConfigFileUTF8functionGets a UTF-8-encoded configuration file name for the current application.
GetCurrentDirUTF8functionGets the name for the current directory.
GetFileDescriptionfunctionGets descriptive information for the specified file name.
GetForcedPathDelimsfunctionPerforms path delimiter substitutions for the specified file name.
GetLazNormalizedFilenamefunctionGets a normalized form of the Filename.
GetPermissionsfunction
GetPhysicalFilenamefunctionGets the physical file name for a symbolic link on the local file system.
GetShellLinkTargetfunctionResolves a Shell Link to the file path for the shortcut.
GetTempFileNameUTF8functionGets a temporary file name using the specified UTF-8-encoded path and prefix.
GetUnixPhysicalFilenamefunctionResolves the symlink in Filename including omitted directories.
InvalidateFileStateCacheprocedureSignals the OnInvalidateFileStateCache event handler.
IsCurrentPathDelimfunctionDetermines if the current path delimiter matches the specified path delimiter notation.
IsUNCPathfunctionIndicates if the specified path uses Universal Naming Convention (UNC).
MergeCmdLineParamsfunctionGenerates a string with the specified list of parameters.
MinimizeSearchPathfunctionTrims the specified path, and removes empty or duplicate paths.
PathIsInPathfunctionChecks whether the specified directory exists in a given path.
PrepareCmdLineOptionfunctionEnsures command line options are properly quoted (when needed).
ReadAllLinksfunctionResolves a symbolic link to an actual file name.
RemoveDirUTF8functionRemoves the directory with the specified name.
RenameFileUTF8functionRenames a file to the specified value.
ResolveDotsfunctionResolves relative path references and removes duplicate path delimiters.
SetCurrentDirUTF8functionSets the current directory to the specified name.
ShortDisplayFilenamefunctionGets a shortened version of the specified file name up to a maximum length.
SplitCmdLineprocedureSplits the specified command line into program and parameter values.
SplitCmdLineParamsprocedureSplits command line parameters separated by whitespace characters into the specified TStrings instance.
StrToCmdLineParamfunctionEnsures that whitespace and quoting in the specified string are valid for use in command line parameters.
SwitchPathDelimsfunctionReplaces path delimiters in a file path with the specified delimiter.
TrimAndExpandDirectoryfunctionCleans and resolves a relative path to a base directory.
TrimAndExpandFilenamefunctionCleans and resolves a file path to the specified base directory name.
TrimFilenamefunctionRemoves leading and trailing spaces, and resolves special characters.
TryCreateRelativePathfunctionAttempts to create a path in Dest relative to the path in Source.
TryReadAllLinksfunctionResolves a symlink to a real file name.
UniversalFileAgeUtf8functionGets the age for the specified file or directory name.

Types

TInvalidateFileStateCacheEventprocedure typeSpecifies the event signalled for an invalid file state in the file cache.
TPathDelimSwitchenumerationRepresents the platform- or OS-specific path delimiters available in the Lazarus LCL.
TPhysicalFilenameOnErrorenumerationEnumerated type representing actions performed for an unresolved file name.

Constants

PathDelimSwitchToDelimconstantConstant array with characters used as path delimiters for supported platforms and OS's.

Variables

OnInvalidateFileStateCachevariableImplements the event handler for a file with an invalid file state.

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.