GetDirectoryName(Path: String): String;
Path — path to a file or a directory.
The GetDirectoryName method returns information about a directory for a specified path.
Sub Main;
Var
Path_File, s: String;
Begin
Path_File:="c:\Work\1.txt";
s:=Path.GetDirectoryName(Path_File);
End Sub Main;
After executing this example, the "s" variable contains a path to a directory where the file 1.txt located.
See also: