IDirectory.GetDirectoryRoot

Syntax

GetDirectoryRoot(Path: String): String;

Parameters

Path - path that corresponds to the directory, which root directory must be obtained.

Description

The GetDirectoryRoot method returns the path to a root directory of the directory passed by the Path parameter.

Comments

Path may contain information about an absolute or a relative path. If a directory specified in Path does not exist, an exception is thrown.

Example

Sub UserProc;
Var
    Root: String;
Begin
    Root := Directory.GetDirectoryRoot(Directory.GetCurrentDirectory);
    Debug.WriteLine(Root);
End Sub UserProc;

After executing the example, a path to a root directory of a working directory of the current application is displayed in the development environment console.

See also:

IDirectory