Perl has
https://metacpan.org/pod/File::Tail and can handle files that get truncated etc
Quote:
If the file does not get altered for a while, File::Tail gets suspicious and starts checking if the file was truncated, or moved and recreated. If anything like that had happened, File::Tail will quietly reopen the file, and continue reading. The only way to affect what happens on reopen is by setting the reset_tail parameter (see below). The effect of this is that the scripts need not be aware when the logfiles were rotated, they will just quietly work on.
|
If you let the src program write to a disk file, this should handle it I think.
Do have a read of the page; it's very informative.