From: Joey Gibson Date: 2003-09-20T04:11:55+09:00 Subject: Re: Trouble with binary files? On 9/19/2003 3:00 PM, agemoagemo@yahoo.com wrote: >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? > Are you on a Windows box and are you opening the file in binary mode? I had this same problem recently with the same results. The problem was a Ctrl-Z some way into the file that was being interpreted as EOF. The fix was to add a 'b' to the open flags: File.open("foo.db", "rb") do ... and then all was right with the world. -- Dean saor, dean saor an spiorad. Is seinn d'orain beo. http://www.joeygibson.com http://www.joeygibson.com/blog/life/Wisdom.html