lua-users home
lua-l archive

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


On Thu, May 14, 2020 at 12:51 PM Mason Bogue <scythe+lua@ortsz.com> wrote:
It seems to me that if we get errors both from ferror() and from
fclose() the correct behavior would be to report *both* errors
somehow. Hiding an error is never helpful unless it is known to be
spurious at the time of implementation.

An error in closing the file after an error has already occurred on the file is highly likely to be spurious -- after a file has had a critical error that would warrant closing the file handle unconditionally, you really can't trust its state, so any error that comes up while trying to clean it up probably isn't helpful.

/s/ Adam 
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org