Next: iklib io buffer, Previous: iklib io binary, Up: iklib io [Index]
The following bindings are exported by the (vicare)
library.
As defined by R6RS: return a default textual port for input. Vicare extends its definition to allow selecting a new textual input port.
As defined by R6RS: return a default textual port for output. Vicare extends its definition to allow selecting a new textual output port.
As defined by R6RS: return a default textual port for error messages output. Vicare extends its definition to allow selecting a new textual output port.
Return #t
if obj is a textual port and, respectively, it is:
input or input/output; output or input/output; input/output.
Return #t
if obj is a textual port and, respectively, it is
input–only or output–only.
Return #t
if obj is an open textual port and, respectively,
it is input, output or input/output.
As defined by R6RS: return a textual input port whose characters are
drawn from string. When eol-style is given: it must be a
symbol selecting an end–of–line style conversion, as accepted by
eol-style
; such conversion is applied to the characters drawn
from string.
If string is modified after open-string-input-port
has been
called, the effect on the returned port is unspecified.
Like open-string-input-port
but allows the specification of a
customised port identifier id, which must be a Scheme string.
As defined by R6RS, return two values: a textual output port and an extraction procedure; the output port accumulates the characters written to it for later extraction by the procedure.
As a Vicare extension, when eol-style is given: it must
be a symbol selecting an end–of–line style conversion, as accepted by
eol-style
; such conversion is applied to the characters written
to the port.
Return the string accumulated in the port opened by
open-string-output-port
. This function can be called also when
the port has been closed.
Like get-char
but track the textual position. Recognise only
linefeed characters as line-ending.
Given a textual port, return the current textual position as a condition
object of type &source-position
.
Build and return textual Scheme ports using the platform file descriptor fd as device. identifier must be a string used for better error reporting. transcoder must be a transcoder object. Closing the Scheme ports will close the file descriptors too.
File descriptor ports do support port position operations.
Build and return textual Scheme ports using the platform file descriptor fd as device. identifier must be a string used for better error reporting. transcoder must be a transcoder object. Closing the Scheme ports will not close the file descriptors.
File descriptor ports do support port position operations.
Build and return a textual Scheme port using the platform socket descriptor sock as device. identifier must be a string used for better error reporting. transcoder must be a transcoder object. Closing the Scheme port will close the socket descriptor too.
Socket ports do not support port position operations.
Build and return a textual Scheme port using the platform socket descriptor sock as device. identifier must be a string used for better error reporting. transcoder must be a transcoder object. Closing the Scheme port will not close the socket descriptor.
Socket ports do not support port position operations.
Read from the textual input port up to and including the linefeed
character or end of file, decoding characters in the same manner as
get-string-n
and get-string-n!
. This function is exactly
like get-line
, defined by (rnrs io ports (6))
, but it uses the
return value of current-input-port
if no port argument is
used.
Defined by Vicare. Read from the textual input port, blocking as necessary, until characters are available or until an end of file is reached.
If characters become available, get-string-some
returns a freshly
allocated string containing the initial available characters (at least
one), and it updates port to point just past these characters.
If no input characters are available: the EOF object is returned.
thunk must be a procedure and it must accept zero arguments. string must be a Scheme string.
The string is used as argument for open-string-input-port
;
during the dynamic extent of the call to thunk, the obtained port
is made the value returned by current-input-port
; the previous
default value is reinstated when the dynamic extent is exited.
When thunk returns, the port is closed automatically. The values returned by thunk are returned.
If, after thunk has returned, an escape procedure is used to reenter the dynamic extent of the call to thunk: the behaviour is unspecified.
Create a textual output port that accumulates the characters written to it, set it as the current output port and call thunk with no arguments. The port is the current output port only for the extent of the call to thunk.
Whenever thunk returns, a string consisting of all of the port’s accumulated characters (regardless of the port’s current position) is returned and the port is closed.
Next: iklib io buffer, Previous: iklib io binary, Up: iklib io [Index]