Question

I see in the CLISP implementation notes the availability of #'read-char-sequence and #'read-byte-sequence. Hot stuff.

But is it possible to seek to a particular point in a file before doing the desired reading?

I've searched both Steele's Common Lisp the Language and the CLISP implementation notes, and not found an answer.

Was it helpful?

Solution

You can use file-position.

(file-position my_stream)

This returns the current position in the file.

(file-position my_stream n)

This sets it to the nth position.

However there are sometimes problems with using this in Unix. Make sure you do not go beyond EOF.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top