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

CreateRelativeSearchPath

Resolves relative path value(s) in the specified search path.

Declaration

Source position: lazfileutils.pas line 103

function CreateRelativeSearchPath(

  const SearchPath: string;

  const BaseDirectory: string

):string;

Arguments

SearchPath

  

Search path(s) examined in the function.

BaseDirectory

  

Directory used as the anchor for resolved relative paths.

Function result

Search path after resolving relative paths to the specified base directory.

Description

CreateRelativeSearchPath is a String function used to resolve one or more paths in SearchPath relative to the directory specified in BaseDirectory. A relative search path is one that assumes the path starts at a given working directory, and could result in an error if that directory is not the current directory on the local file system. CreateRelativeSearchPath ensures that a relative search path is resolved relative to a given directory to provide access to resources in the directory path.

SearchPath can contain multiple path values by using the semicolon character (;) to separate the paths.

BaseDirectory specifies the directory used as the anchor (or root) for each resolved search path.

Paths specified in SearchPath are resolved individually, and recombined with other path values in SearchPath. If either SearchPath or BaseDirectory contain an empty string (''), no actions are performed in the function. The return value contains a copy of the contents in SearchPath with relative paths resolved.

See also

FilenameIsAbsolute

  

Determines if the specified value is an absolute file path (not a relative one).

CreateRelativePath

  

Gets the relative path from BaseDirectory to Filename.


Version 3.2 Generated 2024-02-25 Home