Next: , Previous: , Up: iklib io   [Index]


6.44.4 Additional binary port features

The following bindings are exported by the (vicare) library.

Function: binary-input-port? obj
Function: binary-output-port? obj
Function: binary-input/output-port? obj

Return #t if obj is a binary port and, respectively, it is: input or input/output; output or input/output; input/output.

Function: binary-input-only-port? obj
Function: binary-output-only-port? obj

Return #t if obj is a binary port and, respectively, it is input–only or output–only.

Function: open-binary-port? obj
Function: open-binary-input-port? obj
Function: open-binary-output-port? obj
Function: open-binary-input/output-port? obj

Return #t if obj is an open binary port and, respectively, it is input, output or input/output.

Function: lookahead-two-u8 port

Like lookahead-u8 but peeks at 2 octets and return two values: the EOF object, the would–block object or a fixnum representing first octet; the EOF object, the would–block object or a fixnum representing the second octet.

Function: console-input-port
Function: console-input-port textual-input-port

Return the default textual input port: the default value of the parameter current-input-port; each call returns the same port. When the readline interface is not used, this port is used by the REPL and the debugger.

When applied to an argument: the argument must be a textual input port which replaces the old value; the old port is left untouched (it is not closed). When selecting a new console input port: the same port should be used as top value for the parameter current-input-port.

Function: console-output-port
Function: console-output-port textual-output-port

Return the default textual output port: the default value of the parameter current-output-port; each call returns the same port. This port is used by the REPL and the debugger.

When applied to an argument: the argument must be a textual output port which replaces the old value; the old port is left untouched (it is not closed). When selecting a new console output port: the same port should be used as top value for the parameter current-output-port.

Function: console-error-port
Function: console-error-port textual-output-port

Return the default textual error port: the default value of the parameter current-input-port; each call returns the same port.

When applied to an argument: the argument must be a textual output port and it replaces the old value; the old port is left untouched (it is not closed). When selecting a new console error port: the same port should be used as top value for the parameter current-error-port.

Constant: stdin
Constant: stdout
Constant: stderr

Bound to the values returned by console-input-port, console-output-port, console-error-port respectively.

Function: make-binary-file-descriptor-input-port fd identifier
Function: make-binary-file-descriptor-output-port fd identifier
Function: make-binary-file-descriptor-input/output-port fd identifier

Build and return binary Scheme ports using the platform file descriptor fd as device. identifier must be a string used for better error reporting. Closing the Scheme ports will close the file descriptors too.

File descriptor ports do support port position operations.

Function: make-binary-file-descriptor-input-port* fd identifier
Function: make-binary-file-descriptor-output-port* fd identifier
Function: make-binary-file-descriptor-input/output-port* fd identifier

Build and return binary Scheme ports using the platform file descriptor fd as device. identifier must be a string used for better error reporting. Closing the Scheme ports will not close the file descriptors.

File descriptor ports do support port position operations.

Function: make-binary-socket-input-port sock identifier
Function: make-binary-socket-output-port sock identifier
Function: make-binary-socket-input/output-port sock identifier

Build and return a binary Scheme port using the platform socket descriptor sock as device. identifier must be a string used for better error reporting. Closing the Scheme port will close the socket descriptor too.

Socket ports do not support port position operations.

Function: make-binary-socket-input-port* sock identifier
Function: make-binary-socket-output-port* sock identifier
Function: make-binary-socket-input/output-port* sock identifier

Build and return a binary Scheme port using the platform socket descriptor sock as device. identifier must be a string used for better error reporting. Closing the Scheme port will not close the socket descriptor.

Socket ports do not support port position operations.


Next: , Previous: , Up: iklib io   [Index]