|
Usage |
finder <Class>
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 to GENERAL.exit_success_code only when an
existing file is found (thus allowing finder to be used
in shell scripts).
To see the loadpath used by SmallEiffel, you can for example type the finder command using a bad (non-existent) class name. The default loadpath may be updated (see the READ_ME file in the sys directory).
When invoked without any argument, the finder command prints this help text.
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 loadpath using <class> name in lower case as tail. If necessary, the Eiffel suffix (".e") is added automatically. SmallEiffel only considers suffixed files. Only the first file encountered according to the order of the path is taken in account. A class file is always supposed to have the same name as the class defined inside it.
2. Renamed files -
When the above search has failed to find a file, SmallEiffel tries
to search for files "rename.se" in all the directories of the path.
A file "rename.se" allows the user to put in file "foo" the class
"bar" for example.
This renaming facility has been added especially for DOS (where 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 "/usr/lib/smalleiffel/misc/rename.se" is an example of a "rename.se" file
to put in /usr/lib/smalleiffel/lib_std/ for DOS.
In view of the nature of SamllEiffel's algorithm for finding a class file, it is clear that class loading will be speeded up if renaming is not used.
3. Upper case filenames - Finally,
when neither of the previous steps have found the required Eiffel class file,
SmallEiffel looks along the loadpath for a file bearing the class
name in upper case letters.
Again, if necessary, the Eiffel suffix ".e" is added automatically.
One must note that the overhead to find an upper case file name is
not at all negligible and that a lower case file name may hide another with an
upper case name.
Changing the default loadpath |
The default global loadpath is set using the file
loadpath.system
(see
system configuration
).
To change this default loadpath, you need to create a special
file whose name is "loadpath.se"
in the directory in which you
type a SmallEiffel command (se-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 loadpath.
Hint: to check that your loadpath is correctly set, just
type finder
using a non-existent 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.