Description
stream_property( ?stream, ?stream_property )
stream_property(Stream, Property) is true if and only if Property is a property of Stream. If Stream is bound but Property is not, all Stream's properties will be listed. If it's the other way around, every Stream that has the property Property will be listed. Properties are fetched without blocking the stream.
Stream properties
The stream properties supported include:
- file_name(F). If the stream is linked to a file (as a source or sink), F will hold its name.
- mode(M). M unifies with the mode in which the stream was opened.
- input. The stream has this property when it's an input stream.
- output. The stream has this property when it's an output stream.
- alias(A). A unifies with the stream alias, if any.
- position(P). If the stream has a reposition property, P unifies with the strem current position.
- end_of_stream(E). E is unified with not when we haven't reached the end-of-file, with at when we're right at the end-of-file and with past when we have gone beyond it.
- eof_action(A). If an eof_action(Action was specified when the stream was opened, A will unify with said Action.
- reposition(Bool). If repositioning is possible, Bool will unify with true, else with false.
- type(T). T unifies with the type of the stream, i.e., with text or binary.