next up previous contents index
Next: Glob Up: Functions and procedures Previous: BaseName

DirName

   

Declaration:

Function DirName (Const Path : Pathstr) : Pathstr;

Description:

Returns the directory part of Path.

The directory is the part of Path before the last slash, or empty if there is no slash.

The last character of the result is not a slash, unless the directory is the root directory.

Errors:

None.

See also:

BaseName, FExpand, Dirname (1)

Example
Program Example47;

{ Program to demonstrate the DirName function. }

Uses linux;

Var S : String;

begin
  S:=FExpand(Paramstr(0));
  Writeln ('This program is in directory : ',Dirname(S));
end.



Michael Van Canneyt
Tue Mar 31 16:46:10 CEST 1998