I would start here:
http://raa.ruby-lang.org/search.rhtml?search=binary
(Also, check on rubyforge.org)

You might want to look at Array#pack and String#unpack.
Also, make sure to open up the file as binary!

Enjoy.

On 3/22/07, Yacao Wang <yacaowang / gmail.com> 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.
>
> --
> Alex
>