That's a limitation inherited from R6RS that should probably be lifted.

On Sat, Nov 2, 2019 at 6:15 AM Shiro Kawai <> wrote:
set-port-position only takes the absolute position (not whence + offset as in POSIX).  Is it intentional?
If I want to seek to the end of the file, do I need to take the file size then use set-port-position?

On Fri, Nov 1, 2019 at 1:01 PM John Cowan <> wrote:
I have a pre-SRFI at <>.   I think the SRFI 170 list is currently the best place to review and discuss this.

1) There are flags applicable to any procedure (R7RS-small or SRFI 170) that returns a port.  These are currently specified as a plist, but would work very well using keyword arguments, which is why SRFI 177 is copied here.  The current set:  

a) append (not in R6RS, but really important IMO)

b) bidirectional (allows both input and output on the same port, but a bidirectional input port is not necessarily the same as a bidirectional output port; different things may happen at open time)

c) create (Posix: create the file if it doesn't exist)

d) truncate (Posix: truncate the file to zero length if it does exist)

e) exclusive (Posix: fail if the file exists)

f) buffer (size of buffer if any)

g) char-buffer (size of buffer for conversion between characters and bytes)

h) encoding (name)

i) newline (what the `newline` function outputs)

j) encoding-error (what to do if bytes can't be decoded to characters properly)

k) posix-permissions (when a file is created, what permissions to use; this is _not_ equivalent to creating with one set of permissions and then changing them).

2) The R6RS port positioning package: determine if a port's position can be accessed or modified, and then accessing or modifying it

3) From scsh, select at the level of ports, with timeout.  There are two versions, one that ignores any buffers and one that respects them.

Which of these, if any, are necessary, merely convenient, or downright dispensable?   Please comment.

There are also convenience procedures and macros that don't urgently need discussion.