Вопрос

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.

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top