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



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

FSplit

Split a full-path filename in parts.

Declaration

Source position: dosh.inc line 118

procedure FSplit(

  path: PathStr;

  var dir: DirStr;

  var name: NameStr;

  var ext: ExtStr

);

Description

FSplit splits a full file name into 3 parts : A Path , a Name and an extension (in ext .) The extension is taken to be all letters after the last dot (.). For dos, however, an exception is made when LFNSupport=False , then the extension is defined as all characters after the first dot.

Errors

None.

See also

FSearch

  

Search a file in searchpath

Example

program Example12;

uses Dos;

{ Program to demonstrate the FSplit function. }

var dir:dirstr;
    name:namestr;
    ext:extstr;

begin
  FSplit(ParamStr(1),dir,name,ext);
  WriteLn('Splitted ',ParamStr(1),' in:');
  WriteLn('Path     : ',dir);
  WriteLn('Name     : ',name);
  WriteLn('Extension: ',ext);
end.

Notes

 No notes exist for this page yet. 





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