[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua bug - loadfile gets stdin confused
- From: "David Burgess" <dburgess@...>
- Date: Thu, 19 Apr 2007 07:41:54 +1000
That is true. Perhaps the best solution to all these problems would be
to prohibit Lua from closing a standard file (stdin/stdout/stderr).
Older versions of Lua had this restriction, I cannot remember why
we lifted it.
It happened in 5.1. I think the previous regime of not closing had some
So, either we should check that stdin is valid (how??)
_get_osfhandle(_fileno(stdout)) > 0
means valid. This seems to reliably work for console, services and GUI
So I guess something similar may work for *nix.