B.1 Locating configuration files
PSPP uses the same method to find most of its configuration files:
- The base name of the file being sought is determined.
- The path to search is determined.
- Each directory in the search path, from left to right, is searched for a
file with the name of the base name. The first occurrence is read
as the configuration file.
The first two steps are elaborated below for the sake of our pedantic
friends.
- A base name is a file name lacking an absolute directory
reference. Some examples of base names are: ps-encodings,
devices, devps/DESC (under UNIX), devps\DESC (under
M$ environments).
Determining the base name is a two-step process:
- If the appropriate environment variable is defined, the value of that
variable is used (see Environment variables). For instance, when
searching for the output driver initialization file, the variable
examined is
STAT_OUTPUT_INIT_FILE
.
- Otherwise, the compiled-in default is used. For example, when searching
for the output driver initialization file, the default base name is
devices.
Please note: If a user-specified base name does contain an
absolute directory reference, as in a file name like
/home/pfaff/fonts/TR, no path is searched—the file name is used
exactly as given—and the algorithm terminates.
- The path is the first of the following that is defined:
- A variable definition for the path given in the user environment. This
is a PSPP-specific environment variable name; for instance,
STAT_OUTPUT_INIT_PATH
.
- In some cases, another, less-specific environment variable is checked.
For instance, when searching for font files, the PostScript driver first
checks for a variable with name
STAT_GROFF_FONT_PATH
, then for
one with name GROFF_FONT_PATH
. (However, font searching has its
own list of esoteric search rules.)
- The configuration file path, which is itself determined by the
following rules:
- If the command line contains an option of the form -B path
or --config-dir=path, then the value given on the
rightmost occurrence of such an option is used.
- Otherwise, if the environment variable
STAT_CONFIG_PATH
is
defined, the value of that variable is used.
- Otherwise, the compiled-in fallback default is used. On UNIX machines,
the default fallback path is
- ~/.pspp
- /usr/local/lib/pspp
- /usr/lib/pspp
On DOS machines, the default fallback path is:
- All the paths from the DOS search path in the PATH environment
variable, in left-to-right order.
- C:\PSPP, as a last resort.
Note that the installer of PSPP can easily change this default
fallback path; thus the above should not be taken as gospel.
As a final note: Under DOS, directories given in paths are delimited by
semicolons (;); under UNIX, directories are delimited by colons
(:). This corresponds with the standard path delimiter under
these OSes.