This library provides qsave_program/1 and qsave_program/2, which are
also used by the commandline sequence below.
swipl -o exe -c file.pl ...
- qsave_program(+File) is det
- qsave_program(+File, :Options) is det
- Make a saved state in file `File'.
- make_header(+Out:stream, +SaveClass, +Options) is det[private]
- save_options(+ArchiveHandle, +SaveClass, +Options)[private]
- Save the options in the '$options' resource. The home directory is
saved for development states to make it keep refering to the
The script files (-s script) are not saved at all. I think this is
fine to avoid a save-script loading itself.
- save_option_value(+SaveClass, +OptionName, +OptionValue, -FinalValue)[private]
- save_init_goals(+Stream, +Options)[private]
- Save initialization goals. If there is a
goal(Goal) option, use
that, else save the goals from '$cmd_option_val'/2.
- mkrcname(+Module, +NameSpec, -Name)[private]
- Turn a resource name term into a resource name atom.
- save_resource(+Zipper, +Name, +FileSpec, +Options) is det[private]
- Add the content represented by FileSpec to Zipper under Name.
- create_mapping(+Options) is det[private]
- Call hook to obfuscate symbols.
- lock_files(+SaveClass) is det[private]
- When saving as
runtime, lock all files such that when running the
program the system stops checking existence and modification time on
- To be done
system is a poor name. Maybe use
- save_program(+Zipper, +SaveClass, +Options) is det[private]
- Save the program itself as virtual machine code to Zipper.
- Prepare the --goal=Goal and --toplevel=Goal options. Preparing
implies autoloading the definition and declaring it public such at
it doesn't get obfuscated.
- prepare_state(+Options) is det[private]
- Prepare the executable by running the
- save_autoload(+Options) is det[private]
- Resolve all autoload dependencies.
existence_error(procedures, List) if
in Options and there are undefined predicates.
- save_module(+Module, +SaveClass)[private]
- Saves a module
- Save import relations. An import relation is saved if a
predicate is imported from a module that is not a default module
for the destination module. If the predicate is dynamic, we
always define the explicit import relation to make clear that an
assert must assert on the imported predicate.
- restore_import(+TargetModule, +SourceModule, +PI) is det[private]
- Restore import relation. This notably deals with imports from
user, avoiding a message that the predicate is not
- restore_prolog_flag(+Name, +Value, +Type)[private]
- Deal with possibly protected flags (debug_on_error and
report_error are protected flags for the runtime kernel).
- save_operators(+Options) is det[private]
- Save operators for all modules. Operators for
not saved because these are read-only anyway.
- save_foreign_libraries(+Archive, +Options) is det[private]
- Save current foreign libraries into the archive.
- find_foreign_library(+Architecture, +FileSpec, -EntryName, -File, -Time) is det[private]
- Find the shared object specified by FileSpec for the named
Architecture. EntryName will be the name of the file within the
saved state archive. If posible, the shared object is stripped to
reduce its size. This is achieved by calling
strip -o <tmp>
<shared-object>. Note that (if stripped) the file is a Prolog tmp
file and will be deleted on halt.
- - Should perform OS search on failure
- strip_file(+File, -Stripped) is det[private]
- Try to strip File. Unify Stripped with File if stripping fails for
- qsave:arch_shlib(+Architecture, +FileSpec, -File) is det[multifile]
- This is a user defined hook called by qsave_program/2. It is used to
find a shared library for the specified Architecture, named by
FileSpec. FileSpec is of the form
foreign(Name), a specification
usable by absolute_file_name/2. The predicate should unify File with
the absolute path for the shared library that corresponds to the
If this predicate fails to find a file for the specified
existence_error is thrown.
- zipper_append_file(+Zipper, +Name, +File, +Options) is det[private]
- Append the content of File under Name to the open Zipper.
- zipper_add_directory(+Zipper, +Name, +Dir, +Options) is det[private]
- Add a directory entry. Dir is only used if there is no option
- zipper_append_directory(+Zipper, +Name, +Dir, +Options) is det[private]
- Append the content of Dir below Name in the resource archive.
- Only add entries that match an element from Patterns using
- Ignore entries that match an element from Patterns using
- To be done
- - Process .gitignore. There also seem to exists other
standards for this.
- ignored(+File, +Options) is semidet[private]
- Ignore File if there is an
include(Patterns) option that does not
match File or an
exclude(Patterns) that does match File.
- Called to handle `-c file` compilaton.
- qsave_option(+Name, +ValueStrings, -Value) is semidet[private]
The following predicates are exported, but not or incorrectly documented.
- qsave_program(Arg1, Arg2)