The Lua C API and standard libraries may contain some undocumented, unsupported, and/or experimental features. They are likely unsupported for a good reason, and may disappear or change at any time--use them at your own risk.
Closing a standard file
As of 5.1.3, it is not permitted to close a standard file (e.g. stdin, stdout, and stderr) due to a bug this can cause[1][5]:
> assert(io.stdout:close())
stdin:1: cannot close standard file
Here's a hack around that, which should be used with caution:
local f = assert(io.open '/dev/null') -- or possibly NUL on Windows
debug.setfenv(io.stdout, debug.getfenv(f))
f:close()
assert(io.stdout:close()) -- ok
Old items
- lua_pushliteral is now documented in 5.1.3: [2][6][7]
- The undocumented newproxy function was removed in Lua 5.2, since it was made redundant by other features added in that version.
- Documentation for package.config was added in Lua 5.2. [4]
See also
RecentChanges · preferences
edit · history
Last edited September 27, 2014 1:46 am GMT (diff)