Here is what I have currently:
(defun read-cstring (fd pos)
(alien:with-alien ((c (alien:array (alien:unsigned 8) 1)))
(labels ((accumulating-read (sofar)
(unix:unix-read fd c 1)
(let ((ch (code-char (alien:deref c 0))))
(if (char= ch #\NULL)
sofar
(progn (vector-push-extend ch sofar)
(accumulating-read sofar))))))
(unix:unix-lseek fd pos unix:l_set)
(accumulating-read (make-array 1 :element-type 'character
:adjustable t
:fill-pointer 0)))))- Best way to r/w odd disk structure? Cameron MacKinnon
- Re: Best way to r/w odd disk structure? Cameron MacKinnon
- Re: Best way to r/w odd disk structure? Cameron MacKinnon
- Re: Best way to r/w odd disk structure? Martin Cracauer
