Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > Juggling with binary files?
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 21st October 17:33
andreas thiele
External User
 
Posts: 1
Default Juggling with binary files?



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.

Thought about something roughly like

(defrecord my-rec :size 512 first-value :long second-value :int-le third-value :char osition 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-pl...streams.tar.gz enough (I use
LispWorks)?

Andreas
  Reply With Quote


 


2 21st October 17:33
ralf mattes
External User
 
Posts: 1
Default Juggling with binary files?



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
  Reply With Quote
3 21st October 17:33
andreas thiele
External User
 
Posts: 1
Default Juggling with binary files?


"Ralf Mattes" <rm@mh-freiburg.de> schrieb im Newsbeitrag
newsan.2006.08.31.13.39.39.515486@mh-freiburg.de...

....

Aaarg ) Thanks for the hint - I owe a printed copy of PCL ...

Andreas
  Reply With Quote
4 21st October 17:33
paolo amoroso
External User
 
Posts: 1
Default Juggling with binary files?


"Andreas Thiele" <nospam@nospam.com> writes:


[...]


Yes, see:

Practical: Parsing Binary Files
(chapter 24 of Peter Seibel's book "Practical Common Lisp";
source code available at the book site)
http://www.gigamonkeys.com/book/prac...ary-files.html

BINARY-TYPES
www.cl-user.net/asp/libs/binary-types


Paolo
--
Why Lisp? http://wiki.alu.org/RtL%20Highlight%20Film
The Common Lisp Directory: http://www.cl-user.net
  Reply With Quote
5 21st October 17:33
frode vatvedt fjeld
External User
 
Posts: 1
Default Juggling with binary files?


Paolo Amoroso <amoroso@mclink.it> writes:

I think it would be appropriate to proclaim that my "binary-types"
package should be considered superseded by Peter's package, which
looks to be much nicer code (not to mention the documentation!).

--
Frode Vatvedt Fjeld
  Reply With Quote
6 4th November 15:09
paolo amoroso
External User
 
Posts: 1
Default Juggling with binary files?


Frode Vatvedt Fjeld <frodef@cs.uit.no> writes:


[...]

I have updated the entry.


Paolo
--
Why Lisp? http://wiki.alu.org/RtL%20Highlight%20Film
The Common Lisp Directory: http://www.cl-user.net
  Reply With Quote
7 4th November 15:15
grue
External User
 
Posts: 1
Default Juggling with binary files?


On Thu, 31 Aug 2006 21:05:53 +0200, Paolo Amoroso <amoroso@mclink.it>
tried to confuse everyone with this message:

It's probably worth it to release the PCL code as a separate library, as
happened with CL-FAD.

--
|Don't believe this - you're not worthless ,gr---------.ru
|It's us against millions and we can't take them all... | ue il |
|But we can take them on! | @ma |
| (A Wilhelm Scream - The Rip) |______________|
  Reply With Quote
Reply


Thread Tools
Display Modes




666