Did you know ... Search Documentation:
Pack canny_tudor -- prolog/with/output.pl
PublicShow source
 with_output_to(+FileType, ?Spec, :Goal) is semidet
Runs Goal with current_output pointing at a file with UTF-8 encoding. In (+, -, :) mode, creates a randomly-generated file with random new name unified at Spec. With Spec unbound, generates a random one-time name. Does not try to back-track in order to create a unique random name. Hence overwrites any existing file.

This is an arity-three version of with_output_to/2; same name, different arity. Writes the results of running Goal to some file given by Spec and FileType. Fails if Spec and FileType fail to specify a writable file location.

When Spec unbound, generates a random name. Binds the name to Spec.

 with_output_to_pl(?Spec, :Goal) is semidet
Runs Goal with current_output pointing at a randomly-generated Prolog source file with UTF-8 encoding. In (+, :) mode, creates a Prolog file with name given by Spec.