From: "Brian Schröder" Date: 2005-09-01T18:05:20+09:00 Subject: Re: how to read binary file with char 0x1A On 01/09/05, Eric Hodel wrote: > > On 31 Aug 2005, at 21:24, hsun wrote: > > > Hi, > > > > I tried to read a binary file with a char '0x1A' (EOF on window I > > guess). The method > > > > File::each_byte stops at this char. > > How can get it to read the whole file? Is there a binary mode for > > file operation? > > File.open name, 'rb' do |fp| > # ... > end > > PS: File::each_byte references a class method. You meant > File#each_byte. > That is one of the things that I did not understand for a long time, because File#each_byte is valid ruby, a constant and a comment, and I did not get that it is a way to say "the method of a file instance". So I just wanted to pop in here and say: File#each means each is a method of a File instance maybe that helps someone with the same confusion I had ;-) regards, Brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/