load_files/3

load_files(+Files, +Options)*

Implementation of the consult//11 family. Execution is controlled by the following flags:

  • consult(+ Mode)

This extension controls the type of file to load. If Mode is:

consult, clauses are added to the data-base, unless from the same file; reconsult, clauses are recompiled, db, these are facts that need to be added to the data-base, exo, these are facts with atoms and integers that can be stored in a compact representation (see load_exo//11).

  • silent(+ Bool)

If true, load the file without printing a message. The specified value is the default for all files loaded as a result of loading the specified files.

  • stream(+ Input)

This SWI-Prolog extension compiles the data from the stream Input. If this option is used, Files must be a single atom which is used to identify the source-location of the loaded clauses as well as remove all clauses if the data is re-consulted.

This option is added to allow compiling from non-file locations such as databases, the web, the user (see consult//11) or other servers.

  • compilation_mode(+ Mode)

This extension controls how procedures are compiled. If Mode is compact clauses are compiled and no source code is stored; if it is source clauses are compiled and source code is stored; if it is assert_all clauses are asserted into the data-base.

  • encoding(+ Encoding)

Character encoding used in consulting files. Please (see Encoding) for supported encodings.

  • expand(+ Bool)

If true, run the filenames through expand_file_name//22 and load the returned files. Default is false, except for consult//11 which is intended for interactive use.

  • if(+ Condition)

Load the file only if the specified Condition is satisfied. The value true the file unconditionally, changed loads the file if it was not loaded before, or has been modified since it was loaded the last time, not_loaded loads the file if it was not loaded before.

  • imports(+ ListOrAll)

If all and the file is a module file, import all public predicates. Otherwise import only the named predicates. Each predicate is referred to as \<name\>/\<arity\>. This option has no effect if the file is not a module file.

  • must_be_module(+ Bool)

If true, raise an error if the file is not a module file. Used by use_module//11 and use_module//22.

  • qcompile(+ Value)

SWI-Prolog flag that controls whether loaded files should be also compiled into qly files. The default value is obtained from the flag qcompile:

never, no qly file is generated unless the user calls qsave_file//11 and friends, or sets the qcompile option in load_files//22;

auto, all files are qcompiled.

large, files above 100KB are qcompiled.

part, not supported in YAP.

  • autoload(+ Autoload)

SWI-compatible option where if Autoload is true undefined predicates are loaded on first call.

  • derived_from(+ File)

SWI-compatible option to control make//00. Currently not supported.