Are you sure you want the binary? You can use the bitwise |, ~, and & operators to manipulate the bits of the byte. On Tue, 23 Nov 2004 13:22:56 +0900, ruby talk <rubytalk / gmail.com> wrote: > hmm... i really wanted the binary. is there a to_b? > > > > > On Tue, 23 Nov 2004 13:11:50 +0900, Zach Dennis <zdennis / mktec.com> wrote: > > ruby talk wrote: > > > > > > > > > a=File.open("c:\\1.txt") > > > a.binmode > > > print a.read(1) > > > > > > it prints the char. how can i get and play with the bits and bytes of the file? > > > > a=File.open("c:\\1.txt") > > a.each_byte{ |byte| > > #play with each character/byte here > > } > > > > > > Zach > > > > > >