Previous: , Up: iklib io   [Index]


6.44.8 Miscellaneous port functions

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

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

Return a boolean, #t if obj is a port and it is, respectively, an input–only or an output–only port; otherwise return #f. If obj is an input/output port: return #f.

Function: input/output-port? obj

Return a boolean, #t if obj is a port and it is an input and output port; otherwise return #f. If obj is an input–only or output–only port: return #f.

Function: port-fd port

If port is a port with a file descriptor as device: return a fixnum representing the device, else return #f.

Function: port-id port

Return a Scheme string representing the identifier of port.

Function: port-uid port

Return a gensym uniquely associated to port. The gensym is generated the first time this function is applied to port.

Function: port-hash port

Return a fixnum associated to port to be used as hash key. The gensym is generated the first time this function is applied to port.

Function: port-closed? port

Return #t if port has already been closed, else return #f.

Function: open-port? obj
Function: closed-port? obj

Return #t if obj is a port and it is, respectively, open or closed; otherwise return #f.

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

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

Function: set-port-buffer-mode! port buffer-mode

Reset the port buffer mode to buffer-mode, which must be one of the arguments accepted by buffer-mode. It is an error to select line mode if port is a binary port.

Function: port-dump-status port

To be used for debugging purposes. Write to the current error port some informations on the internals of port.

Function: reset-input-port! input-port
Function: reset-output-port! output-port

Reset to empty the port buffer; return unspecified values. These procedures should be used to attempt an error recovery, only when the port’s underlying device is stateless, for example at the REPL.

Function: make-file-options list-of-symbols

Return an enumeration set as defined by file-options.

Syntax: file-options ?file-options-symbol

As defined by R6RS: return a file–options object that encapsulates the specified options. Each ?file-options-symbol must be a symbol.

Vicare extends the standard options adding the following:

executable

Open the file with executable permissions; before the process’ file mode creation mask is applied, executable permissions are granted to user, group and others. (*manpages*)Set file mode creation mask.


Previous: , Up: iklib io   [Index]