[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Flushing all Buffers Before Exiting



On Tue 26 Mar 2019 at 17:55:28 (+0100), tomas@tuxteam.de wrote:
> On Tue, Mar 26, 2019 at 11:43:24AM -0500, David Wright wrote:
> 
> [...]
> 
> > So these are issues beyond the scope of the OP's problem domain.
> > OTOH, IMO, trapping a USR1 signal [...]
> 
> In this case, an atexit handler seems the right tool. Since the
> OP is using Perl, the END {...} block is our friend.

Sure. Nothing wrong with that. The advantage of trapping a signal
other than those that terminate the program is that you get more
opportunities to use it. IOW, you can send USR1 and examine whatever
properties of the program you like without actually stopping it.
It sounded as if the OP might be interested in this because they
mentioned tee earlier.

But my point was that prodding the program with signals seemed a
better fit than just forcing line buffering.

Cheers,
David.


Reply to: