Hidden Features |
|
|
* The FrontierPattern was added to the reference manual in Lua 5.2. |
|
* The FrontierPattern was added to the reference manual in Lua 5.2. [1] |
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