From: Martin DeMello Date: 2010-08-24T22:39:17+09:00 Subject: Re: Newbie question on file reading On Tue, Aug 24, 2010 at 4:34 PM, Rajarshi Chakravarty wrote: > > My 2nd question is how can I read a file char by char. Basically the > file doesn't have line breaks. How big is your file? IO.read("/path/to/file") will read the entire file into a string. If you really want to read it character by character File.open("/path/to/file") do |f| while true do begin a = f.readchar # do something with a rescue EOFError break end end end martin