[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Cannot redirect stderr
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sat, 14 Nov 2009 18:31:11 -0200
> out = freopen("out.txt", "w", stdout);
> err = freopen("err.txt", "w", stderr);
>
> luaL_dostring(L, "print(\"test1\")");
> luaL_dostring(L, "error(\"test2\")");
The Lua core does not write to stderr. (For that matter, it does not write
at all.) Try checking the return value of luaL_dostring. If it's not 0,
then the error message is at the top of the stack and you can print it
where you like it.