Next: , Previous: , Up: mpg-bpr   [Contents][Index]


11.3.113 library_directory/1   hook

Synopsis

:- multifile user:library_directory/1.

user:library_directory(+DirSpec)

Defines a library directory. Used by predicates taking file_spec as input argument.

Arguments

DirSpec

file_spec

Either an atom giving the path to a file or directory, or PathAlias(DirSpec), where PathAlias is defined by a file_search_path/2 rule.

Description

These facts define directories to search when a file specification library(File) is expanded to the full path, in addition to the predefined library path, which is tried first.

The file_search_path mechanism is an extension of the library_directory scheme and is preferred.

Examples

| ?- [user].
% compiling user...
| :- multifile user:library_directory/1.
| library_directory('/usr/joe_bob/prolog/libs').
| end_of_file.
% compiled user in module user, 0 msec 384 bytes
yes
| ?- ensure_loaded(library(flying)).
% loading file /usr/joe_bob/prolog/libs/flying.qof
…

Exceptions

All error handling is done by the predicates extended by this hook.

See Also

absolute_file_name/[2,3], file_search_path/2, load_files/[1,2],


Send feedback on this subject.