Indy 9
ProcessPath
Unit: IdGlobal
Resolves a directory path containing relative path information.
function ProcessPath(const ABasePath: String; const APath: String; const APathDelim: string = '/'): string;
Unit
IdGlobal
Parameters
const ABasePath: String
The path to use for the current directory in relative path information.
const APath: String
The path including relative directoryinformation to be resolved.
const APathDelim: string = '/'
Path delimiter. Default value is '/'.
Return Value
String - File system directory path after resolution.
Description
ProcessPath is a String function that performs directory path resolution for the values specified in ABasePath and APath. ABasePath is the absolute directory in the local file system to be used as the current directory when resolving path information in APath. APath can contain a relative file path, or a fully-qualified path name to be resolved by the function.

ProcessPath is used when TIdFTPServer.CurrentDir and TIdFTPServer.List are used with path specifiers. ProcessPath is also used when TIdHTTP is used with a URL that contains relative path information.

When APath is an empty string (''), the value in ABasePath is assigned as the return value for ProcessPath. When APath does not begin with the symbol for the root directory ('/'), the value in ABasePath is prepended to the value in APath for resolution.

When APath indicates a path relative to the current directory ('./'), additional directory path resolution is performed. Otherwise, the value in APath is used as the return value for ProcessPath.

The process of directory path resolution involves tracking directory information for any directory path prior to the reference to a relative directory using './' or '../'.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.