I looked at the unpack example 
a=File.open("c:\\1.txt")
a.each_byte { |byte|
      print byte.to_s.unpack('b8'),' ',byte,' ' 
}

But i get this for output
01101100 65 01101100 66 
i know A!=B 
and b* instead of b8 gives me
0110110010101100 65 0110110001101100 66 

Becker


On Tue, 23 Nov 2004 14:59:44 +0900, Eric Hodel <drbrain / segment7.net> wrote:
> On 22 Nov 2004, at 20:22, ruby talk wrote:
> 
> > hmm... i really wanted the binary. is there a to_b?
> 
> I think you want to look at String#unpack.
> 
>