lua-users home
lua-l archive

file:close return value

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


Hi List!
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 function returns. 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?
Cheers!
Lorenzo
P.S.: Happy (late) New Year :-)

AltStyle によって変換されたページ (->オリジナル) /