The finder command



Usage

finder <Class>

Command finder tells you which file is loaded when searching for an Eiffel <Class>.

When an Eiffel file is found, finder prints the full path name on standard output.

The exit status is set GENERAL.exit_success_code only when an existing file is found (thus allowing usage of command finder in shell scripts).

To see the loading path used by SmallEiffel, you can for example type the finder command using a bad (inexistant) class name. The default loading path may be updated (see READ_ME file of the sys directory).

When invoked without any argument, the finder command prints this help.

Where does finder search ?

The algorithm used by SmallEiffel to look for an Eiffel source file is the following:

1. Lower case filenames - SmallEiffel looks all along the loading path using <class> name in lower case as tail. If needed, the Eiffel suffix (".e") is added automatically. SmallEiffel only looks for suffixed files on the disk. Only the first file encountered according to the order of the path is taken in account. File is always supposed to have the same name as the inside class definition.

2. Renamed files - When the above search has failed to find a file, SmallEiffel tries to search for files "rename.se" in all directories of the path.
A file "rename.se" allows the user to put in file "foo" the class "bar" for example.
Such renaming facilities has been added especially for DOS (file names are limited to 8 characters).
Each line of a "rename.se" file is a renaming directive containing two names, first the full name and then the short name to use in the directory where the "rename.se" file is.
File "SmallEiffel/misc/rename.se" is an example of a "rename.se" file to put in SmallEiffel/lib_std/ for DOS.

Thus, knowing the algorithm of SmallEiffel to find a class file, it is better not to use the renaming facilities to speed up class loading.

3. Upper case filenames - Finally, when both previous steps did not find the required Eiffel class file, SmallEiffel looks along the loading path for a file bearing the class name upper in upper case letters. If needed, the Eiffel suffix ".e" is added automatically.
One must note that the overhead to find an upper case file name is not negligeable at all and that a lower case file name may hide some upper case name.

Changing the default loading path

The default global loading path is set using contents of file loadpath.system (see system configuration). To change this default loading path, you need to add a special file which name is "loadpath.se" in the directoy you type a command of SmallEiffel (compile, finder, pretty, ...).
Each line of the file "loadpath.se" must be an existing directory path or the absolute path of another "loadpath.se" file to include recursively.
All directories of the local "loadpath.se" file are added ahead of the default loading path.

Hint: to check that your loading path is correctly set, just type command finder using an unknown class name as argument. Also note that an empty line in a loadpath.se file may add the current working directory in a place you don't want.

[Line]
Copyright © Dominique COLNET and Suzanne COLLIN - <colnet@loria.fr>
Last update: Tuesday November 3rd, 1998