in reply to Reading only new lines from a file

It seems like your code assumes that at the moment it gets the offset it "must be on a newline", which you can never be certain of. Essentially, you are seeking to the last character written at the moment of the seek, which could be anywhere in a line.

== Desire is one product of absence. -- Stephen Opal ==

Replies are listed 'Best First'.
Re^2: Reading only new lines from a file
by dsheroh (Monsignor) on Aug 31, 2007 at 22:04 UTC
    Good point... Modifying it to do a tell after each read and then pass a parameter to _record_offset with the position after the last read which ended in a newline should take care of that.