"Douglas J van Vliet" <dougie / global.co.za> writes: > Hi, > > Is there a way of loading a text file in memory and then accessing > the lines one at a time? > > The files are 4 to 9MB's and take 15 - 20 seconds to load a line at > a time. > > If I use SmallScript (Smalltalk), it takes less than a second or two > to load it. (remainingContents) You must be using the native Win32 version of Ruby 1.6. Ruby 1.6 has very inefficient IO for native Win32. Try the 1.7 versions. The IO functions are just as fast as Unix in those versions. I hope Ruby 1.7 is released as the "stable" version soon for this reason alone! :-) -- matt