lua5.1.4提示"cannot close standard file"解决方法

4 views
Skip to first unread message

剑孤寒

unread,
Mar 5, 2009, 9:04:17 PM3/5/09
to 剑孤寒的游戏编程小站
昨天试用了一下lua5.1.4,
发现有个bug,
如果不是控制台程序,
在关闭程序的时候会提示"cannot close standard file",
临时的修改方案是把输出重定向到stdout:
local f = io.open("NUL")
debug.setfenv(io.stdout, debug.getfenv(f))
f:close()

没想到lua5.1.3和5.1.4都出些郁闷的bug,还是老老实实用老版的lua好了...

Reply all
Reply to author
Forward
0 new messages