3

Is there any SWI's analogue for Turbo's save function, which saves into a file facts, previously loaded via consult and then appended via assert?

1 Answers1

3

I've not found any save-like functions in manual. May be try the following replacement:

% Save whole DB into file
save(FileName) :-
  open(FileName, update, F),
  with_output_to(S, listing),
  close(F).

Or even shorter:

save(FileName) :-
  tell(FileName), listing, told.
Andrew D.
  • 1,022
  • 12
  • 26