[Overview][Constants][Types][Procedures and functions][Variables][Index] |
Gets the relative path from BaseDirectory to Filename.
Source position: lazfileutils.pas line 69
function CreateRelativePath( |
const Filename: string; |
const BaseDirectory: string; |
UsePointDirectory: Boolean = False; |
AlwaysRequireSharedBaseFolder: Boolean = True |
):string; |
Filename |
|
File name for the operation. |
BaseDirectory |
|
Base directory for the relative path. |
UsePointDirectory |
|
True if '.' (current directory symbol) is prepended to the relative path. |
Relative path from the base directory for the file name.
CreateRelativePath is a String function used to get the relative path from BaseDirectory to Filename. A trailing path delimiter in BaseDirectory is ignored. If there is no relative path, the value in Filename is returned.
When BaseDirectory and Filename contain the same value, and UsePointDirectory is False, an empty string ('') is used as the return value. If UsePointDirectory contains True, the return value is the '.' character. Duplicate path delimiters are removed.
Remark: | CreateRelativePath is thread safe, and therefore, does not guarantee that the current directory is correct for file names like 'D:test.txt'. |
|
Attempts to create a path in Dest relative to the path in Source. |
Version 3.2 | Generated 2024-02-25 | Home |