?StreamProperty)True when StreamProperty is a property of Stream.
If enumeration of streams or properties is demanded because either
Stream or StreamProperty are unbound, the
implementation enumerates all candidate streams and properties while
locking the stream database. Properties are fetched without locking the
stream and may be outdated before this predicate returns due to
- If Atom is bound, test if the stream has the specified alias.
Otherwise unify Atom with the first alias of the stream.bugBacktracking
does not give other aliases.
- SWI-Prolog extension to query the buffering mode of this stream.
Buffering is one of
See also open/4.
- SWI-Prolog extension to query the size of the I/O buffer associated to a
stream in bytes. Fails if the stream is not buffered.
- If present and
true, a BOM (Byte Order Mark) was
detected while opening the file for reading, or a BOM was written while
opening the stream. See section
184.108.40.206 for details.
- Determine whether or not abort/0
closes the stream. By default streams are closed.
- Determine whether or not the stream is closed when executing a new
process (exec() in Unix, CreateProcess() in Windows). Default is to
close streams. This maps to fcntl()
F_SETFD using the flag
FD_CLOEXEC on Unix and (negated)
- Query the encoding used for text. See section
2.19.1 for an overview of wide character and encoding issues in
- If Stream is an input stream, unify E with one of
- Unify A with one of
error. See open/4
true, the stream is in an error state. Applies to both
input and output streams.
- If Stream is associated to a file, unify Atom to
the name of this file.
- If the stream is associated with a POSIX file descriptor, unify
Integer with the descriptor number. SWI-Prolog extension used
primarily for integration with foreign code. See also Sfileno()
- True if Stream has mode
- True when Locale is the current locale associated with the
stream. See section 4.23.
- Unify IOMode to the mode given to open/4
for opening the stream. Values are:
and the SWI-Prolog extension
- One of
streams will emit
\n and discard
from input streams. Default depends on the operating system.
- Number of hard links to the file. This expresses the number of‘names'
the file has. Not supported on all operating systems and the value might
be bogus. See the documentation of fstat() for your OS and the value
- True if Stream has mode
- Unify Pos with the current stream position. A stream position
is an opaque term whose fields can be extracted using
See also set_stream_position/2.
- Unify Bool with true if the position of the stream
can be set (see seek/4).
It is assumed the position can be set if the stream has a seek-function
and is not based on a POSIX file descriptor that is not associated to a
- Determines behaviour of character output if the stream cannot represent
a character. For example, an ISO Latin-1 stream cannot represent
Cyrillic characters. The behaviour is one of
an I/O error exception),
escape sequences) or
character entity). The initial mode is
unicode for the user
error for all other streams. See also section
- Time is the timeout currently associated with the stream. See
with the same option. If no timeout is specified,
Time is unified to the atom
- Unify Type with
- This property is reported with Bool equal to
if the stream is associated with a terminal. See also set_stream/2.
- Atom is one of
error (default) or
The latter is intended to deal with service processes for which the
standard output handles are not connected to valid streams. In these
cases write errors may be ignored on