From: bwv549 Date: 2008-11-07T02:18:11+09:00 Subject: Re: how to quickly find a string towards the end of a large io object Here's roughly what I'm using right now (sort of an amalgamation of everyone's thoughts): File.open(filename) do |handle| halfway = handle.stat.size / 2 handle.seek halfway last_half = handle.read params_start_index = last_half.rindex(my_substring) + halfway end using rindex this takes .17 sec on an 85MB file using index it takes .45 sec on the same file Those numbers argue that rindex indeed seeks from the end. Thanks for everyone's help and I will check back to see if there are any more thoughts.