coreutils
[Top][All Lists]
Advanced

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

Re: When and how often to check for output errors?


From: Pádraig Brady
Subject: Re: When and how often to check for output errors?
Date: Sun, 09 Dec 2012 21:59:53 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 12/09/2012 04:16 PM, Cojocaru Alexandru wrote:
Cut never checks error reported by fwrite and putchar. The error checking is 
done by close_stdout.
Paste checks for each and every call to putchar and fwrite (which IMHO is 
overkill).

What should be the correct behaviour? Check each call, or let it be done by 
close_stdout? Or just check after processing a single file?

Best regards,
Cojocaru Alexandru

Good question.

It's a trade off between maintainability and precise errors.
Checking every output function in addition to using close_stdout,
will ensure precise errors in all edge cases,
while just relying on close_stdout will always diagnose errors,
though in certain edge cases not with a precise error message.
Details at:
http://www.gnu.org/ghm/2011/paris/slides/jim-meyering-goodbye-world.pdf

thanks,
Pádraig.



reply via email to

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