lua-users home
lua-l archive

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


> With respect to the output stream problem on Windows. ie. you cannot
> redirect stdout easily to catch Lua output.
>>See previous messages. There are very few functions that use _OUTPUT:
print
and write are the only ones that spring to mind. You can trap these. Ditto
for _INPUT and read. If you want to use the handles directly in your own
routines it's admittedly trickier.
>>This is all be done within Lua already: _STDOUT, _STDIN and _STDERR.

so if i have a wrapped funtion say, (I'm using toLua) :

void tprint(char *p)
{
 printf("t: %s",p);
}

and I redirect stdout to this,

lua_dostring(state,"_STDOUT = tprint");

All stdout should be redirected to tprint()? It doesnt appear to be (I may
have made a mistake somewhere?!).

Nick