Sign in Join
FPDoc Onlineexperiment

SearchAllFilesInPath function

In unit FileUtil

SearchAllFilesInPath - searches for all files named Filename in the given SearchPath using the supplied BasePath with the specified Delimiter and the options listed in Flags.

Declaration

pascal
function SearchAllFilesInPath(const Filename: string; 
 const BasePath: string; 
 const SearchPath: string; 
 const Delimiter: string; 
 Flags: TSearchFileInPathFlags): TStrings

Description

SearchAllFilesInPath is a TStrings function used to get a list with all file names matching the value in FileName.

SearchAllFilesInPath creates the TStringList instance in the return value when needed. The return value can be Nil if no files or directories were found that match the FileName parameter.

Files or directories stored in the return value are fully-qualified path names, with relative path references resolved to the path in BasePath. If FileName contains an absolute path name, the return value has a single entry with the normalized value for FileName.

SearchPath contains one or more search paths examined in the routine. Each search path is separated by the value in Delimiter.

Flags is a set type which contains zero or more options enabled for the search. It can include values from the TSearchFileInPathFlag enumeration, including:

sffDontSearchInBasePath
Omits the directory in BasePath from the search process. Uses only the directories in SearchPath. When not used, matching files in BasePath are included in the search results.
sffFile
Matching entries must be a file and not a directory. Directory names which match FileName are ignored.
sffExecutable
Matching entries must be an executable file for the platform. Non-executable files are ignored.
sffDequoteSearchPath
Removes ANSI Quotation Marks found in the sanitized name for a matching file.

See also

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.