Warning: This is the manual of the legacy Guile 2.0 series. You may want to read the manual of the current stable series instead.

Next: , Previous: , Up: R6RS I/O Ports   [Contents][Index]


6.14.10.10 Output Ports

Scheme Procedure: output-port? obj

Returns #t if the argument is an output port (or a combined input and output port), #f otherwise.

Scheme Procedure: flush-output-port port

Flushes any buffered output from the buffer of output-port to the underlying file, device, or object. The flush-output-port procedure returns an unspecified values.

Scheme Procedure: open-file-output-port filename
Scheme Procedure: open-file-output-port filename file-options
Scheme Procedure: open-file-output-port filename file-options buffer-mode
Scheme Procedure: open-file-output-port filename file-options buffer-mode maybe-transcoder

maybe-transcoder must be either a transcoder or #f.

The open-file-output-port procedure returns an output port for the named file.

The file-options argument, which may determine various aspects of the returned port (see R6RS File Options), defaults to the value of (file-options).

The buffer-mode argument, if supplied, must be one of the symbols that name a buffer mode. The buffer-mode argument defaults to block.

If maybe-transcoder is a transcoder, it becomes the transcoder associated with the port.

If maybe-transcoder is #f or absent, the port will be a binary port and will support the port-position and set-port-position! operations. Otherwise the port will be a textual port, and whether it supports the port-position and set-port-position! operations is implementation-dependent (and possibly transcoder-dependent).

Scheme Procedure: standard-output-port
Scheme Procedure: standard-error-port

Returns a fresh binary output port connected to the standard output or standard error respectively. Whether the port supports the port-position and set-port-position! operations is implementation-dependent.

Scheme Procedure: current-output-port
Scheme Procedure: current-error-port

These return default textual ports for regular output and error output. Normally, these default ports are associated with standard output, and standard error, respectively. The return value of current-output-port can be dynamically re-assigned using the with-output-to-file procedure from the io simple (6) library (see rnrs io simple). A port returned by one of these procedures may or may not have an associated transcoder; if it does, the transcoder is implementation-dependent.


Next: , Previous: , Up: R6RS I/O Ports   [Contents][Index]