Re: random access files

From: Erick Gallesio <>
Date: Fri, 24 Dec 1999 11:39:51 +0100 (CET)

Mayer Goldberg writes:
> Does STk have the equivalent of Common LISP's get-file-position and
> set-file-position? Random access file IO would make Scheme the only language I
> really needed to use. Otherwise, I need to fall back on other languages.

We'll find a solution ;-)

No, such functions don't exists yet in STk. The problem is that they
are probably more useful if you have a file opened in RW mode, which
is something that is not implemented in STk. The lack of RW file is
mostly due to R4RS because they don't fit well in this model. Apart
that, integrating the function for positioning files would not be
complicated, but in general I have tried to keep file access functions
independent of the stream type (file, string and virtual).

Anyway, I have written an extension for these function which work for
file port. It could be easily adapted to string port, but I left it as
exercise ;-). The code is below.

Hope it helps,

                -- Erick

Received on Fri Dec 24 1999 - 11:42:02 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST