This library is loaded with
:- lib(fromonto).and defines several primitives that allow to easily redirect the standard user input or output from or to a given file, stream or string. The available primitives are
[eclipse 1]: write(hello) onto_file scratch. yes. [eclipse 2]: read(X) from_file scratch. X = hello yes. [eclipse 3]: read(X) from_string "s(a,2,[3])". X = s(a, 2, [3]) yes. [eclipse 4]: (write(hello), put(0' ), write(world)) onto_string S. S = "hello world" yes.