lua-users home
lua-l archive

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


On Mon, Feb 16, 2009 at 7:27 PM, Wesley Smith <wesley.hoke@gmail.com> wrote:
> I was wondering what possible issues and solutions might be to change
> the FILE pointer Lua uses for functions like print and error at the

Why not freopen(STDOUT, ...)? freopen() exists for this purpose and
you don't have to change the lua library.

Does error() print anything? I didn't think so. The lua.exe wrapper
does, and you could add a "-O file" option to it to cause it to
freopen() stdout (and stderr).

Also, you can also redefine print() to do something else.

Sam