On Feb 23, 2009, at 5:31 AM, Paul Golea wrote:

> F. Senault wrote:
>>
>> And the second CRC corresponds to what other tools give me.
>>
>> Fred
>
> Excellent!
> I didn't know that File.read opened "badly" files under Windows...
>
> Thank you very much.


Change this:
f = File.read('bibi.jpg') ; nil

to this: (mode of 'r', not 'rb')
f = nil
File.open('bibi.jpg', 'r') { |h| f = h.read } ; nil

And you'll get the same result. File.read is not the problem, but the  
use of text mode (which is the default). Under Unix, there is no  
difference between text mode and binary mode, but the line endings  
under Windows are \015\012.

-Rob

Rob Biedenharn		http://agileconsultingllc.com
Rob / AgileConsultingLLC.com