GetDirectoryRoot(Path: String): String;
Path - a path that corresponds to a directory which root directory should be obtained.
The GetDirectoryRoot method returns a path to a root directory of a directory, passed by the parameter Path.
Path may contain information about an absolute or a relative path. If a directory specified in Path does not exist, an exception is generated.
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: