lua-users home
lua-l archive

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

1) Does io.output() close the previously default output file (if any) or 
should the latter be closed with io.close() before calling io.output() to 
select another output file?

2) The reference manual says (5.4): "Unless otherwise stated, all I/O 
functions return nil on failure (plus an error message as a second result) 
and some value different from nil on success".
However, file.close() seems to return true on success, but calls an error on 

3) In which mode does io.input(filename) open the file? "r" or "w"? (is "in 
text mode" in the reference manual a typo? My 5-2003 version could not be the 

4) Does io.input() return a file object (handle) even when an argument is 
given? It seems so.

5) same as 4) for io.output.


P.S. I thought that a Lua programmer is not necessarily a C programmer, so in 
the reference card (well, "large card") I am detailing also the math library 
and the format() directives.