lua-users home
lua-l archive

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


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.

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