An example of a directory hierarchy that has a constant structure,
but that may be installed at different parts of the file system, is
the Quintus installation hierarchy. Several file_search_path/2
facts are defined in the system to support the flexibility of this
installation.
The predefined file_search_path/2
facts are dynamic and multifile,
so they can be redefined or expanded by users.
In the Quintus Prolog Development System installed for a Sparc running Solaris,
the following predefined file_search_path/2
facts exist
to specify the location of certain Development System related directories:
file_search_path(quintus,quintus-directory). file_search_path(runtime,runtime-directory). file_search_path(runtime,''). file_search_path(system,'sun4-5'). file_search_path(system,sun4). file_search_path(system,''). file_search_path(helpsys,quintus('generic/q3.5/helpsys')). file_search_path(helpsys,package(helpsys)). file_search_path(qplib,quintus('generic/qplib3.5')). file_search_path(library,A) :- library_directory(A). file_search_path(messages,qplib(embed)). file_search_path(language,english). file_search_path(demo,quintus('generic/q3.5/demo/bench')). file_search_path(demo,quintus('generic/q3.5/demo/chat')). file_search_path(demo,quintus('generic/q3.5/demo/curses')). file_search_path(demo,quintus('generic/q3.5/demo/math')). file_search_path(demo,quintus('generic/q3.5/demo/menu')). file_search_path(demo,quintus('generic/q3.5/demo/search')). file_search_path(demo,quintus('generic/q3.5/demo/wafer')). file_search_path(demo,qplib('IPC/TCP/demo')). file_search_path(demo,qplib('IPC/RPC/demo')). file_search_path(demo,package(demo)). file_search_path(tutorial,quintus('generic/q3.5/tutorial')). file_search_path(tutorial,package(tutorial)). file_search_path(package,qplib(structs)). file_search_path(package,qplib(objects)). file_search_path(package,qplib(prologbeans)). file_search_path(package,quintus('qui3.5')). file_search_path(package,quintus('proxt3.5')). file_search_path(package,quintus('proxl3.5')).
quintus-directory is the root of the Quintus installation hierarchy. It is the directory where Quintus Prolog is installed, and is also returned by
| ?- prolog_flag(quintus_directory, QuintusDir).
(see ref-lps-flg-cha, for discussion of prolog_flag
s). The Prolog flag
host_type
creates the system facts.
The path aliases predefined by the file_search_path/2
facts above
have the following interpretation:
quintus
runtime
runtime
prolog_flag/2
;
in the Development System, the current working directory is also added as a
runtime path;
system
system
specific directories;
helpsys
qplib
library_directory/1
facts below;
library
library_directory/1
facts for
compatibility with previous releases;
package
library
, helpsys
, demo
, and
tutorial
);
messages
QU_messages
);
language
QU_messages.pl
, which thus can be retrieved
using the file specification messages(language('QU_messages'))
;
demo
tutorial
Windows note: The
syslib
file search path is provided to allow standard convention for Windows to be followed when searching for DLLs and libraries specified inload_foreign_executable/1
. At startup time, Prolog assertssyslib
file search path facts based upon the path specified in the environment variablePATH
(as well as a couple of standard locations).When running
qld
, thesyslib
file search path will be initialized to the path specified in the environment variableLIB
in order to follow the Microsoft linker convention.Therefore, the directive
:- load_foreign_executable(syslib(kernel32)).executed in the Development System will load
kernel32.dll
from a directory in thePATH
environment variable, whereas if it is encountered byqld
, the environment variableLIB
will be used to locate the import librarykernel32.lib
.The syslib file search paths can be modified by user code in the Development System or with the
-f
and-F
options toqld
if necessary.
The library directories defined by the system are:
library_directory(qplib(library)). library_directory(qplib(tools)). library_directory(qplib('IPC/TCP')). library_directory(qplib('IPC/RPC')). library_directory(qplib(embed)). library_directory(package(library)).
Note that these file_search_path/2
and library_directory/1
tables,
except for helpsys
,
are also defined in qpc
and qld
(see too-too-qpc and
too-too-qld).