| > I would look at a Gray Streams solution. You could have a specialized
| > stream class where a READ-SEQUENCE method specialized to your
| > class could directly read double-floats into the lisp array and also
| > READ could do its thing on the meta data. You would implement
| > the class methods using unix:unix-open, unix:unix-read, unix:unix-write
| > etc.
| >
| > Paul
|
| I don't entirely understand your suggestion.  In this scheme, what
| would I have to implement?  Would I have to implement myself all the
| lower-level things (stream-read-char, stream-unread-char, etc.), and
| then put the CL reader on top of that somehow?

You would implement at least enough to do what you want.
stream-read/write-char/byte
and stream-read/write-sequence for sure. Also you would need a function to
open
the stream.

|
| At first, I thought that unix-read and unix-write might help me even
| without Gray streams, but they seem to suffer from the same problems
| as my earlier approaches --- I don't seem to be able to interleave C-
| and CL-level IO operations.

No, of course not.

Consider having a lisp readable header at the beginning of the file
containing
meta data and possibly including an offset to where the binary stuff
started.
You could open the file with :element-type 'base-char and read in the meta
stuff,
then close it and reopen with :element-type 'double-float , position to the
binary offset
and use read-sequence to fill your array.
An extension of this approach would be to have multiple meta areas
throughout the file
that you could get to via info in the first one.

Paul



Reply via email to