All file systems have a limited length for filenames. Descriptive Eiffel class names often exceed such limits. For that, SmallEiffel allows to provide a file "rename.se", in which every line contains the real (short) name of the file for a certain class. For example:
yy_compressed_scanner_skeleton.e yy_compressed_scanner_skelet.eThe only bad thing about that: somebody has to create the "rename.se", which is very boring. Fortunately, this tool does it automatically.
yy_interactive_scanner_skeleton.e yy_interactive_scanner_skele.e
`Make_rename_se' assumes that you have a ZIP archive, where the classes are stored with their long names. Furthermore, `unzip' available from the Info-ZIP homepage must be within the search path.
Both `make_rename_se' and `unzip' should work on all systems supported by SmallEiffel. However, output redirection has to be supported by the OS.
As this is a developer tool without any use for sensible human beings, you have to compile it yourself. Simply type
compile -boost -clean make_rename_se
This should create an optimized version.
Possible command line options are:
Order and case of option names don't matter. And no silly "-", "--" or "/" prefix is needed.
If you don't specify a length, an internal default with a ridiculously low value is used, which guarantees pretty useless filenames. So you better specify one.
Usage is simple. All you have to know is the name of the ZIP archive and the maximum length of filenames on your system.
Here is an example on how to create "rename.se" files for the popular Gobo library under AmigaOS.
makedir gobo
cd gobo
unzip gobo15.zipNow the directory tree of gobo has been created. Furthermore, you can be sure that `unzip' is in the search path. If it didn't work out, get `unzip' as mentioned above.
make_rename_se length 30 gobo15.zipAlternatively, you could also have typed
make_rename_se amiga gobo15.zip
After pressing RETURN, you see what is going on. Basically, the tool first creates a listing of the ZIP file contents to find out the real, possibly too long, names of the classes. It then analyzes directories in the archive and generates unique short names for every class. By doing that it ensures that every file gets a ".e" suffix and does not have the same name as another class in the same directory (which could easily happen if it would just cut the name).
After that, it extracts all classes with too long names and renames them to the unique short name. While doing that, it also generates the "rename.se" for every directory where files had to be renamed.
The output should look something like this:
unzip -l >t:make_rename_se.tmp "sofa_archive:gobo15.zip"
read archive list
analyze
src/geyacc/
library/structure/sort/
library/structure/list/
library/structure/base/
library/parse/yacc/
...
rename library/kernel/spec/ve/
kl_imported_fixed_array_rout.e <- kl_imported_fixed_array_routines.e
kl_imported_string_buffer_ro.e <- kl_imported_string_buffer_routines.e
kl_imported_output_stream_ro.e <- kl_imported_output_stream_routines.e
kl_imported_input_stream_rou.e <- kl_imported_input_stream_routines.e
kl_imported_fixed_array_type.e
rename library/kernel/spec/se/
kl_imported_fixed_array_rout.e <- kl_imported_fixed_array_routines.e
kl_imported_string_buffer_ro.e <- kl_imported_string_buffer_routines.e
kl_imported_output_stream_ro.e <- kl_imported_output_stream_routines.e
kl_imported_input_stream_rou.e <- kl_imported_input_stream_routines.e
kl_imported_fixed_array_type.e
...
Only classes with filenames longer than 30 characters are extracted from the ZIP archive and renamed.
Classes with exactly 30 characters are just extracted, for example "kl_imported_fixed_array_type.e ". This is to make sure that they didn't get lost during the renaming and extracting of all the other classes. Without going too much into detail, file systems behave differently when having to deal with too long names, and this avoids all sorts of trouble.
If a directory contains many ".e" files, but all of them have names shorter or equal than 30 characters, no "rename.se" is created.
make_rename_se dos gobo15.zipon a Unix box.