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

# FSearch

Search for file in search path.

## Declaration

Source position: oldlinux.pp line 1581

`function FSearch(`
`const path: PathStr;`
`dirlist: string`
`):PathStr;`

## Description

FSearch searches in DirList, a colon separated list of directories, for a file named Path. It then returns a path to the found file.

## Errors

An empty string if no such file was found.

## See also

BaseName |  | Return basename of a file
DirName |  | Extract directory part from filename
FExpand |  | Expand filename to fully qualified path
FNMatch |  | Check whether filename matches wildcard specification

## Example

    Program Example46;

    { Program to demonstrate the FSearch function. }

    Uses oldlinux,strings;

    begin
      Writeln ('ls is in : ',FSearch ('ls',strpas(Getenv('PATH'))));
    end.

Documentation generated on: Feb 26 2014