Next: , Previous: R6RS End-of-File, Up: R6RS I/O Ports


6.14.10.2 Port Manipulation

The procedures listed below operate on any kind of R6RS I/O port.

— Scheme Procedure: port-position port

If port supports it (see below), return the offset (an integer) indicating where the next octet will be read from/written to in port. If port does not support this operation, an error condition is raised.

This is similar to Guile's seek procedure with the SEEK_CUR argument (see Random Access).

— Scheme Procedure: port-has-port-position? port

Return #t is port supports port-position.

— Scheme Procedure: set-port-position! port offset

If port supports it (see below), set the position where the next octet will be read from/written to port to offset (an integer). If port does not support this operation, an error condition is raised.

This is similar to Guile's seek procedure with the SEEK_SET argument (see Random Access).

— Scheme Procedure: port-has-set-port-position!? port

Return #t is port supports set-port-position!.

— Scheme Procedure: call-with-port port proc

Call proc, passing it port and closing port upon exit of proc. Return the return values of proc.