This module implements a collection of predicates to read/write streams (or files) from/to several sources (lists of terms, strings, predicate output, etc.).
Reads from Stream a line of text and unifies Line with it. The end of the line can have Unix  or Windows/DOS [13, 10] termination, which is not included in Line. At EOF, the term end_of_file is returned.
line(L) :- string(L). line(end_of_file).
Reads in String all the characters from Stream until an EOF is found.
Reads in all the bytes from Stream until an EOF is found.
Reads in Bytes at most N bytes from Stream, or until an EOF is found.
Copies all bytes bytes (until EOF or error) from the InS stream into the OutS stream. The number of copied bytes is returned in Copied
Behaves like current_input(S), write_string(S, String).
Behaves like current_input(S), write_bytes(S, Bytes).
Reads all the characters from the file FileName and returns them in String.
Reads all the bytes from the file FileName and returns them in Bytes.