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



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

ExtractFileDir

Extract the drive and directory part of a filename.

Declaration

Source position: finah.inc line 32

function ExtractFileDir(

  const FileName: String

):String;

Description

ExtractFileDir returns only the directory part of FileName, including a driveletter. The directory name has NO ending directory separator, in difference with ExtractFilePath.

Errors

None.

See also

ExtractFileName

  

Extract the filename part from a full path filename.

ExtractFilePath

  

Extract the path from a filename.

ExtractFileDir

  

Extract the drive and directory part of a filename.

ExtractFileDrive

  

Extract the drive part from a filename.

ExtractFileExt

  

Return the extension from a filename.

ExtractRelativePath

  

Extract a relative path from a filename, given a base directory.

Example

Program Example34;

{ This program demonstrates the ExtractFileName function }
{$H+}
Uses sysutils;

Procedure Testit(F : String);

begin
 Writeln ('FileName      : ',F);
 Writeln ('Has Name      : ',ExtractFileName(F));
 Writeln ('Has Path      : ',ExtractFilePath(F));
 Writeln ('Has Extension : ',ExtractFileExt(F));
 Writeln ('Has Directory : ',ExtractFileDir(F));
 Writeln ('Has Drive     : ',ExtractFileDrive(F));
end;

Begin
  Testit (Paramstr(0));
  Testit ('/usr/local/bin/mysqld');
  Testit ('c:\pp\bin\win32\ppc386.exe');
  Testit ('/pp/bin/win32/ppc386.exe');
End.

Notes

 No notes exist for this page yet. 





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