[plt-scheme] seek/tell for ports...
On Dec 17, riandouglas at iprimus.com.au wrote:
> Is there a method to seek to a position in a file, and get the
> current position in a file, as in the C fseek/ftell functions.
Welcome to MzScheme version 205, Copyright (c) 1995-2003 PLT
> (with-output-to-file "x" (lambda () (display "abcdefghijklmnop")))
> (define x (open-input-file "x"))
> (file-position x)
0
> (file-position x 10)
> (list (read-char x) (read-char x))
(#\k #\l)
> (file-position x)
12
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!