eof_actiononly applies to the read stream,
representation_errorsonly applies to the write stream and trying to set
line_positionon a pair results in a
permission_errorexception. See also stream_property/2 and open/4.
- Set the alias of an already created stream. If AliasName is
the name of one of the standard streams, this stream is rebound. Thus,
set_stream(S, current_input)is the same as set_input/1, and by setting the alias of a stream to
user_input, etc., 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 bytes.
- Determine whether or not the stream is closed by abort/0. By default, streams are closed.
- Set the
close_on_execproperty. 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
bomcauses 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 fails.
- 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 4.23.
- 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
\rcharacter 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
binary. See also open/4 and the
encodingproperty of streams. Switching to
binarysets the encoding to
octet. Switching to
textsets 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 and section 2.19.1.
- 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.