# &find(4)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

&find - Find a file on the search path
&which - Find a program on the path

## SYNOPSIS

&find <basename> <extension>
&which <progname>

## DESCRIPTION

&find searches for a named file <basename><extension> on the MicroEmacs 2009 search path defined by the variable $search-path(5), initialized by the system of from the 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 `ERROR`.

<basename>

The base name of the file, excluding any extension.

<extension>

The extension of the file name, this must be specified with the extension delimiter, typically dot ('`.`'). A `NULL` string (e.g. '`""`') may be specified if no extension is required.

&which searches for the given executable program <progname> on the system program search path defined the the environment variable $PATH.

## USAGE

&find is typically used with insert-file(2) and find-file(2) within macro scripts, and is used to locate user specific files.

## EXAMPLE

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.

## SEE ALSO

Variable Functions, find-file(2), insert-file(2), $search-path(5), $MEINSTALLPATH(5), $MEUSERPATH(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>