Konrad Meyer wrote:
> Quoth 7stud --:
>> #create a data file containing:
>> 
>>     else
>>       break
>>     end
>> 
>>   end
>> end
> 
> IO#each_with_index and IO#readline are probably the same internally, so 
> the
> real answer here is that NO, IO#readline is NOT the same as
> File.read.split('\n'), that's IO#readlines.
>

The real question is: does readline do any buffering?  What about 
each()?  If a file has ten lines in it, does ruby access the file ten 
times?  Or, does ruby read some reasonable amount of data into a buffer?

-- 
Posted via http://www.ruby-forum.com/.