Re: Juggling with binary files?



On Thu, 31 Aug 2006 15:30:15 +0200, Andreas Thiele wrote:

Hi,

currently I have to process binary files. They contain 8, 16 and 32 bit values in little and big
endian format as well as 8 bit characters and any mix of these. I am thinking about easy access to
the individual values and don't want to re-invent the wheel.

Peter `the Siebel' Seibel has some nice code in his book
"Practical Common Lisp" (chapters on reading MP3 data). This
should be a good starting point without wheel reinvention.

HTH Ralf Mattes

P.S: The book is online - just cliki it up

Thought about something roughly like

(defrecord my-rec :size 512 first-value :long second-value :int-le third-value :char :position 200
forth-value (:char 10))

(with-record-slots (first-value forth-value) my-rec
(any-function first-value)
(another-function forth-value))

So I have several questions:

1. Does something like this already exist?
2. If not 1., should I think about making it stream based (perhaps using gray-streams) for my
implementation?
3. If 2., is trivial-gray-streams
http://common-lisp.net/project/cl-plus-ssl/download/trivial-gray-streams.tar.gz enough (I use
LispWorks)?

Andreas

.