Subject: [clisp-list] File 'seek'ing

From: Jeremy Doolin <[email-masked]>
Date: Mon Apr 22 14:07:03 2002

I was wondering if there is a way to change your position in a file when
reading to and writing from the file? something similar to the 'seek'
functions in C.

By the way, I'd like to mention that I'm using a binary I/O stream and
read/write-byte for I/O functions.  

So I'd like to be able to:

(let
    ((foo (open "myfile" :element-type '(unsigned-byte 8) :direction
:input)))
    (seek foo 45) ;;; move ahead 45 bytes
    (read foo)
    ...)

Any advice?

Jeremy Doolin
-- 
May all your disgraces be private

---

From: Edi Weitz <[email-masked]>
Date: Mon Apr 22 14:39:03 2002

>     (seek foo 45) ;;; move ahead 45 bytes

FILE-POSITION,
cf. <http://www.xanalys.com/software_tools/reference/HyperSpec/Body/f_file_p.htm>

Edi.