Added `port-position' and `set-port-position!' operations on file I/O
authorArthur Gleckler <edu/mit/csail/zurich/arthur>
Wed, 4 Oct 2006 05:51:55 +0000 (05:51 +0000)
committerArthur Gleckler <edu/mit/csail/zurich/arthur>
Wed, 4 Oct 2006 05:51:55 +0000 (05:51 +0000)
commiteb936acecc9d820a1495f1bb41feb738867515bb
tree687407409ffdeda2db1d388e46a755cef5850444
parenta330c398280e18b4f79345171799de3a2dc8bf2b
Added `port-position' and `set-port-position!' operations on file I/O
ports.  The `port-position' procedure returns the offset, in bytes,
from the beginning of the file.  The `set-port-position!' procedure
sets the position.

Both operations work only on ports that are opened with binary
normalizers or denormalizers, i.e. ones that make no transformation.
We should consider lifting this restriction, but this is a useful
addition even with it.

When used with output ports, the port passed to these procedures must
also be an input port.

The `port-position' procedure works even after a character has been
"unread", even for ports with non-single-byte character encodings.
v7/src/runtime/fileio.scm
v7/src/runtime/genio.scm
v7/src/runtime/port.scm
v7/src/runtime/runtime.pkg
v7/src/runtime/strout.scm