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



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

FSearch

Search a file in searchpath

Declaration

Source position: dosh.inc line 116

function FSearch(

  path: PathStr;

  dirlist: String

):PathStr;

Description

FSearch searches the file Path in all directories listed in DirList. The full name of the found file is returned. DirList must be a list of directories, separated by semi-colons. When no file is found, an empty string is returned.

Remark: On unix systems, DirList can also be separated by colons, as is customary on those environments.

Errors

None.

See also

FExpand

  

Expand a relative path to an absolute path

Example

program Example10;

uses Dos;

{ Program to demonstrate the FSearch function. }

var s:pathstr;

begin
  s:=FSearch(ParamStr(1),GetEnv('PATH'));
  if s='' then
    WriteLn(ParamStr(1),' not Found in PATH')
  else
    Writeln(ParamStr(1),' Found in PATH at ',s);
end.

Notes

 No notes exist for this page yet. 





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