lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>    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.