Navigation

Operators and Keywords

Function List:

C++ API

: file_in_path (path, file)
: file_in_path (path, file, "all")

Return the absolute name of file if it can be found in path.

The value of path should be a colon-separated list of directories in the format described for path. If no file is found, return an empty character string. For example:

file_in_path (EXEC_PATH, "sh")
    ⇒ "/bin/sh"

If the second argument is a cell array of strings, search each directory of the path for element of the cell array and return the first that matches.

If the third optional argument "all" is supplied, return a cell array containing the list of all files that have the same name in the path. If no files are found, return an empty cell array.

See also: file_in_loadpath, dir_in_loadpath, path.

Package: octave