This is the mail archive of the
mailing list for the Cygwin project.
Re: Can't reliably redirect standard output from C# program in recent Cygwin
On Mon, Mar 12, 2012 at 05:28:17PM -0000, James Johnston wrote:
>Well, good call. I shouldn't have jumped to conclusions. Both my C++
>and C# examples still fail:
Not really a call. It was obviously different failure. The previous
fix wasn't even pipe related.
But, regardless, Corinna (who has more time these days to look into
this type of thing) found a damning piece of MSDN documentation which
indicates that a write of zero bytes to a pipe will cause a read of
zero bytes on the other end of the pipe. So, a program which assumes
that a zero byte read means EOF, like most Linux programs, will stop
processing when it sees the zero bytes from ReadFile.
Corinna sent me a patch to fix the problem which I've mildly tweaked and
installed. It's in the latest snapshot.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple