bug-gawk
[Top][All Lists]
Advanced

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

Re: Undetected fatal errors from redirected print


From: Miguel Pineiro Jr.
Subject: Re: Undetected fatal errors from redirected print
Date: Tue, 23 Nov 2021 13:30:09 -0500
User-agent: Cyrus-JMAP/3.5.0-alpha0-1371-g2296cc3491-fm-20211109.003-g2296cc34

Hi, Andy and Arnold.

I disagree with your conclusion. Before I drop the matter, allow me to reframe 
the problem, because I think the fact that the situation involves the closing 
of streams has muddied the waters. For the moment, let's forget about 
fclose(3), close(2), close_rp, and close_redir; instead let's focus on the 
print statement.

The GNU Awk User’s Guide, 5.10 Enabling Nonfatal Output:
"In standard awk, output with print or printf to a nonexistent file, or some 
other I/O error (such as filling up the disk) is a fatal error."

efwrite handles the actual printing for print and printf. efwrite correctly 
dies when writing fails. However, because of buffering, efwrite sometimes 
doesn't even attempt to write. It simply stores the data and returns success. 
If the quote from the user's guide is correct, returning success without 
writing the data is a promise to die in the future if the data cannot be 
written.

Thank you both for taking the time to consider my report,
Miguel



reply via email to

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