lua-users home
lua-l archive

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




Am 14.05.2020 um 21:57 schrieb Massimo Sala <massimo.sala.71@gmail.com>:

Yes Adam, you explain the problem very well.


Roberto Ierusalimschy wrote:
I still fail to see the bug. What is the problem if the error reported is a real error in 'fclose' instead of the previous error


Obviously I disagree with Roberto :-)
The function must return the first error condition, any other solution is unreliable so useless.

You must also read _and_ understand the documentation of the functions involved, especially under which circumstances the cause which failure.

Then you can decide if the situation can really arise when _reading_ a file or not.


I am a newbie in the "Lua ecosystem".
Every software has bugs, big and small.
Lua is an excellent tool; we can only improve it.

M



On Thu, 14 May 2020, 20:21 Coda Highland, <chighland@gmail.com> wrote:

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
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org

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