From: ruby talk Date: 2004-11-24T00:48:22+09:00 Subject: Re: binary reading 10000010 65 01000010 66 the output is still wrong I also tried adding a.binmode no luck. Will i also have such a problem writing a binary file? Becker On Tue, 23 Nov 2004 21:39:42 +0900, Hugh Sasse Staff Elec Eng wrote: > > What about (written as if it were a patch): > > - a=File.open("c:\\1.txt") > + a=File.open("c:\\1.txt", 'rb') > a.each_byte { |byte| > - print byte.to_s.unpack('b8'),' ',byte,' ' > + print byte.chr.unpack('b8'),' ',byte,' ' > } > > > Hugh > >