LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-14-2024, 12:36 AM   #16
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,391

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774

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.

Last edited by chrism01; 06-14-2024 at 12:37 AM. Reason: s/i/I/ ;)
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to capture volatile memory walterbyrd Linux - Security 1 11-27-2020 09:26 AM
[SOLVED] Advice on best / safest way to capture root password grail Programming 26 06-21-2011 04:40 PM
Running Xvidcap (for screen capture ) + audacity (for audio capture) simultaneously vikram_cvk Linux - Software 2 05-20-2011 03:26 AM
Best way to capture of image of linux computer bctechman Linux - Software 9 10-19-2009 11:06 PM
Capture support for dvd and video capture in linux is it even going to be real ever? maximalred Linux - Distributions 3 07-06-2003 07:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration