[Top][All Lists]

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

Re: Undetected fatal errors from redirected print

From: Andrew J. Schorr
Subject: Re: Undetected fatal errors from redirected print
Date: Tue, 23 Nov 2021 18:24:37 -0500
User-agent: Mutt/1.5.21 (2010-09-15)


On Tue, Nov 23, 2021 at 05:31:28PM -0500, Miguel Pineiro Jr. wrote:
> I understand what you're saying here, but I don't think it's relevant. Gawk 
> is silent when a stream fails to close cleanly and I have nothing to say 
> about that. The closing of the stream just happens to be where a fatal print 
> error (imho) mistakenly becomes benign.
> I believe the print output should be flushed before fclose, so that a print 
> error can be treated differently from a close error.

I don't understand the point you're making here; what's the difference between
getting an error on fclose vs a final fflush before calling fclose? The fclose
has to do an implicit fflush, of course, before closing the file. Are you
suggesting we should call fflush prior to fclose and then issue an error if
fflush fails (but not if fclose fails)? Perhaps I'm confused.  I thought the
issue was how to handle an error that is not detected until the file is closed.
Am I thinking about it incorrectly? I'm still not sure why people have
complained in the past about getting an error when close fails, but I presume
there must have been reasons.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]