help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Types][Procedures and functions][Variables] Reference for unit 'unixutil' (#rtl)

Basename

Return basename of a file

Declaration

Source position: unixutil.pp line 34

function Basename(

  const path: PathStr;

  const suf: PathStr

):PathStr;

Description

Returns the filename part of Path, stripping off Suf if it exists. The filename part is the whole name if Path contains no slash, or the part of Path after the last slash. The last character of the result is not a slash, unless the directory is the root directory.

Errors

None.

See also

DirName

  

Extract directory part from filename

Example

Program Example48;

{ Program to demonstrate the BaseName function. }

Uses Unix,UnixUtil;

Var S : String;

begin
  S:=FExpand(Paramstr(0));
  Writeln ('This program is called : ',Basename(S,''));
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505