From: Tristin Davis Date: 2008-03-10T07:01:55+09:00 Subject: Re: IO#Foreach -- Max line length Gotcha, I'll post the code once i revamp ;) 7stud -- wrote: > Tristin Davis wrote: >> That's what the 2nd if statement is; for catching the delimiter if the >> buffer isn't too large. I can't use gets b/c I may expend all the >> memory before the actual line is read. >> > > Look. A string and a file are really no different--except reading from > a file is slow. Therefore, to speed things up read in the maximum every > time you read from the file, and store it in a string. Process the > string just like you would the file. Then read from the file again. -- Posted via http://www.ruby-forum.com/.