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

FileSearchUTF8

Searches for a file with the specified name in the list of directory paths.

Declaration

Source position: lazfileutils.pas line 122

function FileSearchUTF8(

  const Name: string;

  const DirList: string;

  ImplicitCurrentDir: Boolean = True

):string;

Arguments

Name

  

File name to locate in the list of directory paths.

DirList

  

The delimited list of directory paths to search.

Function result

Path and file name for the matching file, or an empty string.

Description

FileSearchUTF8 is a String function used to search for files with the specified name in the list of directory paths.

DirList is a list of file paths to search in the function. Values in DirList are separated by the PathSeparator character for the environment. No additional directories are searched when DirList contains an empty string ('').

ImplicitCurrentDir controls whether the search is implicitly limited to the current directory. The default value for ImplicitCurrentDir is True. When a file with the specified Name is located in the current directory, no additional searches are needed. The return value is the name of the file without any path information.

When ImplicitCurrentDir is False, each path in DirList is searched for a file with the specified name. The search is stopped when the first file with the specified file name is found. The return value contains the path in DirList where the file name was located along with the file name, or an empty string ('') if the specified file is not found in the search.


Version 3.2 Generated 2024-02-25 Home