[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Reading binary file written by C program

Ara.T.Howard

3/22/2007 9:04:00 PM

1 Answer

Patrick Hurley

3/22/2007 9:48:00 PM

0

On 3/22/07, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> On Fri, 23 Mar 2007, Yacao Wang wrote:
>
> > Hi all,
> >
> > I've learned some basic of Ruby and I need to write a program that can read
> > data from binary files written by a C program. I was supposed to use the
> > company library to do this using C++ but I really feel that this job could
> > be done more quickly with the advanced features of Ruby. The binary files
> > are generally directly dumped by C structs. Is there a "ruby way" of doing
> > this? Thanks in advance.
>
> look for joel's bitstruct on rubyforge
>
> -a
> --
> be kind whenever possible... it is always possible.
> - the dalai lama
>
>

Which is a fast, better solution for simple structures, binary-parse
can handle very complex nested structures, arrays and the like.

pth