Arbortext Command Language > Functions by Alphabetical Listing > find_file_in_path
  
find_file_in_path
find_file_in_path (filename[, mode[, pathlist[, defaultpath]]])
This function searches the list of directories specified by pathlist for the file given by filename returning the path name of the first match if found.
The mode parameter specifies the permissions for the file and is one of the following characters:
e — exists
r — read
w — write
x — executable
If mode is omitted, e is assumed.
If pathlist is omitted, the value of the PATH environment variable is used. Each directory component in pathlist is expanded using expand_file_name so home directory and environment variable references are permitted.
The defaultpath parameter specifies the default value for a %D qualifier given as part of pathlist, that is, the value of defaultpath will be substituted for %D. If omitted, no substitution is done. See the third example below.
The function returns the null string if filename is not found within the pathlist, or is not accessible according to mode.
Examples

browser = find_file_in_path("Netscape");
logofile = find_file_in_path("logo.gif", "r", option("graphicspath"));
cfile = find_file_in_path("catalog", "r", ".${main::PCS}%D", \
option("catalogpath"));
Related Topics
expand_file_name function