From: Adrián Arroyo Calle Date: Tue, 16 Nov 2021 22:54:04 +0000 (+0100) Subject: Add phrase_to_file/3 (phrase_to_file with Options) X-Git-Tag: v0.9.0~26^2~1 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=8e68626f141d3f73d7c0f8a34ab58c65c72928c5;p=scryer-prolog.git Add phrase_to_file/3 (phrase_to_file with Options) --- diff --git a/src/lib/pio.pl b/src/lib/pio.pl index 18ceaab5..3b7ba4e1 100644 --- a/src/lib/pio.pl +++ b/src/lib/pio.pl @@ -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)).