Add phrase_to_file/3 (phrase_to_file with Options)

This commit is contained in:
Adrián Arroyo Calle
2021-11-16 23:54:04 +01:00
parent 75b01d5021
commit 8e68626f14

View File

@@ -109,6 +109,9 @@ phrase_to_stream(GRBody, Stream) :-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
phrase_to_file(GRBody, File) :-
setup_call_cleanup(open(File, write, Stream),
phrase_to_file(GRBody, File).
phrase_to_file(GRBody, File, Options) :-
setup_call_cleanup(open(File, write, Stream, Options),
phrase_to_stream(GRBody, Stream),
close(Stream)).