+Attribute)Modify an attribute of an existing stream. Attribute
specifies the stream property to set. If stream is a pair (see stream_pair/3)
both streams are modified, unless the property is only meaningful on one
of the streams or setting both is not meaningful. In particular,
eof_action only applies to the read stream,
representation_errors only applies to the write
stream and trying to set
on a pair results in a
permission_error exception. See also
- Set the alias of an already created stream. If AliasName is
the name of one of the standard streams, this stream is rebound. Thus,
current_input) is the same as set_input/1,
and by setting the alias of a stream to
all user terminal input is read from this stream. See also interactor/0.
- Set the buffering mode of an already created stream. Buffering is one of
- Set the size of the I/O buffer of the underlying stream to Size
- Determine whether or not the stream is closed by abort/0.
By default, streams are closed.
- Set the
close_on_exec property. See stream_property/2.
- Defines the mapping between bytes and character codes used for the
stream. See section
2.19.1 for supported encodings. The value
bom causes the stream to check whether the current
character is a Unicode BOM marker. If a BOM marker is found, the
encoding is set accordingly and the call succeeds. Otherwise the call
- Set end-of-file handling to one of
- Set the filename associated to this stream. This call can be used to set
the file for error locations if Stream corresponds to
FileName and is not obtained by opening the file directly
but, for example, through a network service.
- Set the line position attribute of the stream. This feature is intended
to correct position management of the stream after sending a terminal
escape sequence (e.g., setting ANSI character attributes). Setting this
attribute raises a permission error if the stream does not record
positions. See line_position/2
- Change the locale of the stream. See section
- Set input or output translation for newlines. See corresponding
for details. In addition to the detected modes, an input stream can be
set in mode
detect. It will be set to
dos if a
character was removed.
- This option can be used to make streams generate an exception if it
takes longer than Seconds before any new data arrives at the
stream. The value infinite (default) makes the stream block
indefinitely. Like wait_for_input/3,
this call only applies to streams that support the select() system call.
For further information about timeout handling, see wait_for_input/3.
The exception is of the form
timeout_error(read, Stream), _)
- Set the type of the stream to one of
See also open/4
encoding property of streams. Switching to
sets the encoding to
octet. Switching to
text sets the encoding to the default text encoding.
- Do/do not record the line count and line position (see line_count/2
set_stream(S, record_position(true)) resets the
position the start of line 1.
- Change the behaviour when writing characters to the stream that cannot
be represented by the encoding. See also stream_property/2
- Modify whether Prolog thinks there is a terminal (i.e. human
interaction) connected to this stream. On Unix systems the initial value
comes from isatty(). On Windows, the initial user streams are supposed
to be associated to a terminal. See also stream_property/2.