Lua5 IO Library

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Lua5 IO Library

D Burgess
I am reposting the question because I suspect it got lost
in the LuaCheia avalanche.

 In Lua4 parlance, where we have _STDIN, _STDOUT, _STDERR 
 and _ALERT(a function). Could we have _STDINFUNC, 


Is there a way that the new IO Library can be used to
dynamically revector calls that read/write/flush to
stdin/stderr/stdout? The requirement is for FastCGI,
MSWindows GUI Windows, Windows Pipes etc.

The stdin/stderr/stdout may not be FILE* handles.
The and print() need to adapt

 if running as a Windows GUI app then
    io.stdout = pointer to a structure containing a windows handle
    io.write() is different function

 else running as a FastCGI app then    
    io.stdout = pointer to a FastCGI structure
    io.write() is different function

iolib provides file handles as accessible objects, could we
please have globally accessible lua_cfunctions for the stdout/
stderr/stdin io?

In Lua4 parlance, where we hav _STDIN, _STDOUT, _STDERR and

In other words make, write() with std handles
dynamically replaceable just like print().