[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Cannot redirect stderr
- From: "Matthew P. Del Buono" <delbu9c1@...>
- Date: Sat, 14 Nov 2009 12:33:55 -0500
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