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