Seek's 3rd argument indicates what kind of seek to do.
0 means from the front of the file, 1 means relative to the current
position and 2 means from the end of the file. By using the
"seek from EOF" option you can use the above
algorithm without having to compute the filesize first.