Thank you very much!! That's exactly what I was looking for!

I just added

file.seek(-2000,IO::SEEK_END)

right after the line

fileSize = File.size(fileName)

and it worked perfectly! It's running about 18x faster - which is a huge 
improvement - I think the guys at work will be satisifed with it's speed 
now!

Thanks again Lex!! :D

Lex Williams wrote:
> Lex Williams wrote:
>> Here is an usage example :
>> 
>> begin
>>   file = File.open(ARGV[0])
>> rescue
>>   puts "file does not exist or is not a file\n"
>> end
>> 
>> file.seek(-25,IO::SEEK_END)
>> puts file.readlines
>> 
>> The code will read the rest of the files from that location . Try it on 
>> a file and see .
> 
> I meant the rest of the lines . Sorry .

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