Where should software reside? Although individually a minor annoyance, cumulatively this question represents many thousands of frustrated user hours spent trying to find support files or guessing where packages need to be installed. Even simple programs require proper habitat; games need to find their score files.
Aren't there standards for this? Some Operating Systems have devised regimes of software habitats -- only to have them violated by large software packages and imports from other OS varieties.
In some programs, the expected locations of support files are fixed at time of compilation. This means that the program may not run on configurations unanticipated by the authors. Compiling locations into a program also can make it immovable -- necessitating recompilation to install it.
Programs of the world unite! You have nothing to lose but loss itself.
The function scm_find_impl_file in `scm.c' is an attempt to
create a utility (for inclusion in programs) which will hide the details
of platform-dependent file habitat conventions. It takes as input the
pathname of the executable file which is running. If there are systems
for which this information is either not available or unrelated to the
locations of support files, then a higher level interface will be
needed.
bin', `BIN', `exe', or `EXE' and support files in a
directroy named `lib', which is a peer the executable directory.
This arrangement allows multiple executables can be stored in a single
directory. For example, the executable might be in
`/usr/local/bin/' and initialization file in
`/usr/local/lib/'.
If the executable directory name matches, the peer directroy `lib'
is tested for initname.
lib' directories become too crowded. So we look in any
subdirectories of `lib' or `src' having the name (sans type
suffix such as `.EXE') of the program we are running. For example,
the executable might be `/usr/local/bin/foo' and initialization
file in `/usr/local/lib/foo/'.
lib' or `src'
peers.
C:\foo\bar.exe' and the initialization file in `C:\foo\bar\'.