lua-users home
lua-l archive

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


>> lua_dostring(state,"_STDOUT = tprint");

>>This doesn't work, because _STDOUT is a handle. You can't replace a handle
>>with a function and expect things to work. Like I said before, you have to
>>redefine print and write.

> Right okay, I have been fiddling around with the code so I wasnt sure if I
> had broken something in trying this. It would be nice if this
functionality
> worked?

> My suggestion for adding lua_stdout and lua_stderr allows you to redefine
> stdout and stderr at runtime if you dont have the advantage of being able
to
> redirect these streams. eg. in Windows. You may want to do this for
example
> if you use Lua to load some kind of debug library at runtime which catches
> stderr. I realise I can edit the Lua code but it would be nice if this
were
> the default functionality.

Can't the lua library function "writeto" be used to change stdout at
runtime?  I don't know about stderr though...

Falko