lua-users home
lua-l archive

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


On 10/29/13, Paul Chavent <paul.chavent@fnac.net> wrote:
> On 10/29/2013 12:32 AM, Leo Razoumov wrote:
>> On Sat, Oct 26, 2013 at 6:07 PM, Paul Chavent <paul.chavent@fnac.net>
>> wrote:
>>> Hi.
>>>
>>> I would like to be able to redirect the lua prints.
>>>
>>
>> Simply call io.output(filename)  and you are done.
>>
>> --Leo--
>>
>
> I "redirect" the lua interpreter input/output to a socket if the remote side
> is connected ... As i feel better in C for doing such things, i didn't try
> with lua calls.
>
> Thank for the tips anyway.
>
> Paul.
>

Paul,
you can call io.output(file_handle) passing it a Lua file-handle which
you can get but opening TCP socket using
luasocket for example.
Patching Lua source to achive output redirection looks like overkill to me.

--Leo--