"ruby talk" <rubytalk / gmail.com> schrieb im Newsbeitrag
news:25094bf7041123040921b14b34 / mail.gmail.com...
> 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

>> File.open("buildnumber","rb") {|a| a.each_byte {|b| printf("%s %4d
%08b\n", b.chr,b,b) } }
V   86 01010110
e  101 01100101
r  114 01110010
s  115 01110011
i  105 01101001
o  111 01101111
n  110 01101110
    32 00100000
4   52 00110100
..   46 00101110
4   52 00110100
    32 00100000
B   66 01000010
u  117 01110101
i  105 01101001
l  108 01101100
d  100 01100100
    32 00100000
1   49 00110001
6   54 00110110
2   50 00110010
=> #<File:buildnumber (closed)>

Regards

    robert