11.3.188 restore/1

Synopsis

restore(+FileSpec)

Restores a saved-state.

Arguments

FileSpec
file_spec, must be ground

The name of a saved state, ‘.sav’ extension optional.

Description

The system is returned to the program state previously saved to the file denoted by FileSpec with start-up goal Goal. restore/1 may succeed, fail or raise an exception depending on Goal.

Exceptions

instantiation_error
type_error
In FileSpec.
existence_error
The specified file does not exist. If the fileerrors Prolog flag is off, the predicate fails instead of raising this exception.
permission_error
A specified file is not readable. If the fileerrors Prolog flag is off, the predicate fails instead of raising this exception.

Examples

     | ?- save_program(state, format('Restored!\n',[])).
     % /home/matsc/sicstus4/Bips/state.sav created in 0 msec
     yes
     
     | ?- restore(state).
     % restoring /home/matsc/sicstus4/Bips/state.sav...
     % /home/matsc/sicstus4/Bips/state.sav restored in 10 msec 16 bytes
     Restored!
     yes

See Also

save_program/[1,2], ref-sls, ref-sls-sst.


Send feedback on this subject.