☰

Stream handling and operations

Author(s): The Ciao Development Team.

This module reexports the predicates required for stream handling (stream_basic) and input/output operations (io_basic). See the documentation of the reexported modules for further details.

Usage and interface

  • Library usage:
    :- use_module(library(streams)).

Documentation on exports

PREDICATEopen/3
ISOopen(File,Mode,Stream)

Usage 1:

Normal use.

Usage 2:

In the special case that File is an integer, it is assumed to be a file descriptor passed to Prolog from a foreign function call. The file descriptor is connected to a Prolog stream (invoking the C POSIX function fdopen()) which is unified with Stream.

Reexported from stream_basic.

PREDICATEopen/4
open(File,Mode,Stream,Options)

Reexported from stream_basic.

REGTYPEio_mode/1

Usage:io_mode(M)

M is an opening mode ('read', 'write' or 'append').

Reexported from stream_basic.

open_buf_read(Bytes,Stream)

Reexported from stream_basic.

open_buf_write(Stream)

Reexported from stream_basic.

open_buf_pipe(In,Out)

Reexported from stream_basic.

set_pipe_feeder(In,Pred)

Reexported from stream_basic.

set_pipe_drainer(Out,Pred)

Reexported from stream_basic.

PREDICATEpipe_writer/2
pipe_writer(In,Out)

Reexported from stream_basic.

buf_stream_contents(Stream,Bytes)

Reexported from stream_basic.

PREDICATEclose/1
ISOclose(Stream)

Reexported from stream_basic.

PREDICATEset_input/1
ISOset_input(Stream)

Reexported from stream_basic.

ISOcurrent_input(Stream)

Reexported from stream_basic.

PREDICATEset_output/1
ISOset_output(Stream)

Reexported from stream_basic.

ISOcurrent_output(Stream)

Reexported from stream_basic.

character_count(Stream,Count)

Reexported from stream_basic.

PREDICATEline_count/2
line_count(Stream,Count)

Reexported from stream_basic.

line_position(Stream,Count)

Reexported from stream_basic.

stream_byte_position(Stream,ByteNo)

Reexported from stream_basic.

stream_set_position(Stream,CharNo,LineNo,LinePos,ByteNo)

Reexported from stream_basic.

stream_is_repositionable(Stream)

Reexported from stream_basic.

ISOflush_output(Stream)

Reexported from stream_basic.

ISOflush_output

Reexported from stream_basic.

PREDICATEclearerr/1
clearerr(Stream)

Reexported from stream_basic.

current_stream(Filename,Mode,Stream)

Reexported from stream_basic.

Reexported from stream_basic.

PREDICATEstream_code/2
stream_code(Stream,StreamCode)

Reexported from stream_basic.

absolute_file_name(RelFileSpec,AbsFileSpec)

Usage:absolute_file_name(RelFileSpec,AbsFileSpec)

AbsFileSpec is the absolute name (with full path) of RelFileSpec.

Reexported from stream_basic.

absolute_file_name(Spec,Opt,Suffix,CurrDir,AbsFile,AbsBase,AbsDir)

Reexported from stream_basic.

Reexported from stream_basic.

REGTYPEstream/1

Usage:stream(S)

S is an open stream.

Reexported from stream_basic.

Usage:stream_alias(S)

S is the alias of an open stream, i.e., an atom which represents a stream at Prolog level.

Reexported from stream_basic.

Usage:sourcename(F)

F is a source name.

Reexported from stream_basic.

Usage:open_option_list(L)

L is a list of options for open/4.

Reexported from stream_basic.

PREDICATEpipe/2
ISO

Reexported from stream_basic.

PREDICATEget_code/2
ISOget_code(Stream,Code)

Reexported from io_basic.

PREDICATEget_code/1
ISOget_code(Code)

Reexported from io_basic.

PREDICATEget1_code/2
get1_code(Stream,Code)

Reexported from io_basic.

PREDICATEget1_code/1
get1_code(Code)

Reexported from io_basic.

PREDICATEpeek_code/2
ISOpeek_code(Stream,Code)

Reexported from io_basic.

PREDICATEpeek_code/1
ISOpeek_code(Code)

Reexported from io_basic.

PREDICATEskip_code/2
skip_code(Stream,Code)

Reexported from io_basic.

PREDICATEskip_code/1
skip_code(Code)

Reexported from io_basic.

PREDICATEskip_line/1
skip_line(Stream)

Reexported from io_basic.

PREDICATEskip_line/0
skip_line

Reexported from io_basic.

PREDICATEput_code/2
ISOput_code(Stream,Code)

Reexported from io_basic.

PREDICATEput_code/1
ISOput_code(Code)

Reexported from io_basic.

PREDICATEnl/1
ISOnl(Stream)

Reexported from io_basic.

PREDICATEnl/0
ISOnl

Reexported from io_basic.

PREDICATEtab/2
tab(Stream,Num)

Reexported from io_basic.

PREDICATEtab/1
tab(Num)

Reexported from io_basic.

PREDICATEcode_class/2
code_class(Code,Class)

Reexported from io_basic.

string_bytes(String,Bytes)

Reexported from io_basic.

PREDICATEgetct/2
getct(Code,Type)

Reexported from io_basic.

PREDICATEgetct1/2
getct1(Code,Type)

Reexported from io_basic.

PREDICATEget_byte/2
ISOget_byte(Stream,Byte)

Reexported from io_basic.

PREDICATEget_byte/1
ISOget_byte(Byte)

Reexported from io_basic.

PREDICATEpeek_byte/2
ISOpeek_byte(Stream,Byte)

Reexported from io_basic.

PREDICATEpeek_byte/1
ISOpeek_byte(Byte)

Reexported from io_basic.

PREDICATEput_byte/2
ISOput_byte(Stream,Byte)

Reexported from io_basic.

PREDICATEput_byte/1
ISOput_byte(Byte)

Reexported from io_basic.

ISOat_end_of_stream(Stream)

Reexported from io_basic.

ISOat_end_of_stream

Reexported from io_basic.

PREDICATEdisplay/2
display(Stream,Term)

Reexported from io_basic.

PREDICATEdisplay/1
display(Term)

Reexported from io_basic.

PREDICATEdisplayq/2
displayq(Stream,Term)

Reexported from io_basic.

PREDICATEdisplayq/1
displayq(Term)

Reexported from io_basic.

Documentation on imports

This module has the following direct dependencies: