lua-users home
lua-l archive

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


Pierre LeMoine wrote:
>> Firstly, Lua is not an acronym :)  Secondly, does Windows have a call
>> similar to UNIX's dup2?  This lets you duplicate a file handle to a
>> specific one (ie, so you can easily set what handles 1, 2 and 3
>> (stdout, in and err) go to.
> 
> This page says it does. Haven't tested it.
> http://msdn.microsoft.com/en-us/library/8syseb29%28VS.80%29.aspx

While that function exists, typically the mechanism through which to
redirect stderr/stdout/stdin is through CreateProcess and CreatePipe:

http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx

I know it's a lot more work; it's just how it's done.

If it's not a child process, you have a much simpler function:

http://msdn.microsoft.com/en-us/library/ms686244(VS.85).aspx

======

Matthew P. Del Buono