Are you using the “b” modifier on the open call?
···
-----Original Message-----
From: agemoagemo@yahoo.com [mailto:agemoagemo@yahoo.com]
Sent: Friday, September 19, 2003 2:01 PM
To: ruby-talk ML
Subject: Trouble with binary files?I’m trying to write a program that will read a binary
file into an buffer, do stuff with it, and then write
the result back into another file. However, I’m
running into a problem.I haven’t been able to find a way that will read in
more than the first 160 bytes (of a 910 byte file).
I’ve tried using each_byte and looping with getc, as
well as storing the results in a string or an array.I’ve never had this sort of problem working with text
files. Is there something else I have to do to be able
to work with binary data?
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com