I would like to read only the last line of a text file (I'm on UNIX, can use Boost). All the methods I know require scanning through the entire file to get the last line which is not efficient at all. Is there an efficient way to get only the last line?
Also, I need this to be robust enough that it works even if the text file in question is constantly being appended to by another process.