[Overview][Constants][Types][Procedures and functions][Variables][Index] |
Resolves relative path references and removes duplicate path delimiters.
Source position: lazfileutils.pas line 61
function ResolveDots( |
const AFilename: string |
):string; |
AFilename |
|
Qualified file name examined in the routine. |
File name with relative paths expanded and duplicate delimiters removed.
ResolveDots is a String function used to convert relative path information in AFilename to an absolute path reference. A relative path includes characters like '.' (for current directory - not a file name extension) and '..' (parent directory). Duplicate path limiters ('\\' for Windows) ('//' for UNIX-like environments) are converted to a single instance of the PathDelimiter defined for the platform.
For Windows platforms, drive letter designations and delimiters like 'C:' are recognized. A path starting with the UNC naming convention ('\\?\') is not resolved in the method.
Windows-specific file system quirks handled in the routine include:
For UNIX-like environments, the resolved path may be invalid if it references the parent directory and the initial directory in the path is a symbolic link.
When AFilename ends with a relative path ('/.' or '/..'), the path is resolved to the directory represented by the relative value. The current directory for '/.' or the parent directory for '/..'.
If a relative path reference cannot be resolved for the local file system, the original path information is retained.
Some common examples include:
Macros found in the AFilename are retained in the resolved file name. For example:
'($LazarusDir)/../path/that/may/be/invalid/for/macro/filename.ext'
If AFilename ends with a path trailing path delimiter or a relative path reference, the return value will end with a trailing path delimiter.
Version 3.2 | Generated 2024-02-25 | Home |