Re: Best method for seeking to n lines before end of file [ implementation of tail ]



graemenewla...@xxxxxxxxx wrote:

Perhaps someone can help me with a problem I have at the moment and is
causing some debate with my colleagues:

What is the best technique to seek to the end of a file and load in
say, the last 10 lines like the tail command does.

For small numbers I just read the last 10 lines with
File::ReadBackwards and reverse() them.

I probably wouldn't use File::Tail (although at first choice it seems
the natural choice) because although it could do this it's really
concerned with implementing 'tail -f'.

.