These predicates link an external source/sink with a Prolog stream, its stream-term and stream alias. They enable the source/sink to be opened and closed, and its properties found during execution.
The following predicates do not have examples to automate in this test:
current_input/1
current_output/1
set_input/1
set_output/1
close/2
close/1
flush_output/1
flush_output/0
at_end_of_stream/0
at_end_of_stream/1
set_stream_position/2
open/4
,
open/3
open(Source_sink, Mode, Stream, Options)
is true.
The predicate
open/3
provides a similar functionality to
open/4
except that a goal
open(Source_sink, Mode, Stream)
opens the source/sink
Source_sink
with an empty list of stream-options.
Templates and modes for the predicate are as follows:
open(@source_sink, @io_mode, -stream, @stream_options) open(@source_sink, @io_mode, -stream)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
open('/user/roger/data', read, D, [type(binary)]). | null | true |
open('/user/scowen', write, D, [alias(editor)]). | null | true |
open('/user/dave/data', read, DD, []). | null | true |
stream_property/2
stream_property(Stream, Property)
is true iff the stream associated with the stream-term
Stream
has stream property
Property
.
stream_property(Stream, Property)
is re-executable.
Templates and modes for the predicate are as follows:
stream_property(?stream, ?stream_property)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
stream_property(S, file_name(F)). | null | true |
stream_property(S, output). | null | true |