From: Bill Atkins Date: 2004-11-23T14:00:07+09:00 Subject: Re: binary reading 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 wrote: > hmm... i really wanted the binary. is there a to_b? > > > > > On Tue, 23 Nov 2004 13:11:50 +0900, Zach Dennis 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 > > > > > >