Question

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?

Was it helpful?

Solution

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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top