IDirectory.GetDirectoryRoot

Syntax

GetDirectoryRoot(Path: String): String;

Parameters

Path - a path that corresponds to a directory which root  directory should be obtained.

Description

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

Comments

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

Example

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

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

See also:

IDirectory