on win32 writef and friends don't use redirected std handles if they are piped.
stdin/out/err handles 0, 1 and 2 are not the redirected versions on win32. one needs to get redirected handles with
GetStdHandle(STD_INPUT_HANDLE);
etc.
therefore, the std handles from std.c.stdio used in std.stdio probably cannot be constant.
Comment #1 by andrei — 2010-11-26T17:50:31Z
I'd work on this but don't have a Windows machine. Could someone else take this bug over? Also, is it reproducible on D2? Thanks.
Comment #2 by dfj1esp02 — 2010-11-28T11:00:30Z
In fact, I have a working plugin that retabifies source, passed to stdin, though, as I see it uses my io streams that I wrote in order to fix bug 2742 :)
Comment #3 by andrei — 2011-06-05T08:08:20Z
I'm putting this up for grabs as I don't have a Windows system to test on.
Comment #4 by andrei — 2015-11-03T17:39:36Z
Is this bug still valid? Does it apply to D2?
Comment #5 by edwards.ac — 2021-05-18T17:40:57Z
Validated that this issue is resolved on both Win7 and Win10. No problems encountered after compiling with -m32 and piping output of resulting executable to file.