&find(4)&find - Find a file on the search path
&which - Find a program on the path
&find <basename> <extension>
&which <progname>
&find searches for a named file <basename><extension> on the MicroEmacs search path defined by the variable $search-path(5), initialized by the system from the environment variables $MEINSTALLPATH(5) etc.
Each path component defined in $search-path is prepended to the constructed file name and it's existence is tested. If the file exists, then the FULL path name of the file is returned to the caller, otherwise the string "ERROR" is returned.
<basename>
<extension>
&which searches for the given executable program <progname> on the system program search path defined by the environment variable $PATH. If the program is found, then the FULL path to the program is returned, otherwise the string "ERROR" is returned.
Note that on dos and Windows only the extensions .bat, .cmd, .com and .exe are checked for.
&find is typically used with insert-file(2) and find-file(2) within macro scripts, and is used to locate user specific files.
The following example uses &find to locate the uses 'C' template file. Given a $search-path setting of /usr/bob/emacs:/usr/local/microemacs:-
insert-file &find "c" ".etf"
Would insert the file /usr/bob/emacs/c.etf if it existed, else the file /usr/local/microemacs/c.etf if it exists.
Variable Functions, find-file(2), insert-file(2), $search-path(5), $MEINSTALLPATH(5), $MEUSERPATH(5).
(c) Copyright JASSPA 2025
Last Modified: 2025/01/09
Generated On: 2025/09/29