[plt-scheme] Seeking to the end of a file

From: Anton van Straaten (anton at appsolutions.com)
Date: Sun Nov 13 17:09:31 EST 2005

Hans Oesterholt wrote:
> I'm looking for equivalent of the C construct fseek(filep,0,SEEK_END)
> AFAIK I don't read this in the docs of file-position.

If you have the filename, you can of course use this:

    (file-position port (file-size filename))

If you don't have the filename (e.g. you're writing a library routine 
which accepts a port), I don't know if there's a way to do it, without 
resorting to the FFI or C code.

Anton


Posted on the users mailing list.