[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: file:close return value
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Tue, 05 Jan 2016 18:12:16 +0100
I just realized that the manual doesn't say much about the return value
of file:close for handles created by regular io.open.
A not-so-in-depth scan of liolib.c code seems to confirm my initial
assumption that, more or less, it returns what the underlying C fclose
The problem is that this is not documented, but probably it should,
since a fclose failure may mean that the write-buffered data could have
been lost or something like that.
I didn't check thoroughly, but the same could apply to file:close (which
I assume it relies on C's fflush).
IMHO the manual should mention at least briefly what those methods
return in general. What do you think?
P.S.: Happy (late) New Year :-)