Message-ID: From: "Allsted, Geir" To: "'djgpp AT delorie DOT com'" Subject: Multiplie Redirections in dos. Date: Wed, 3 Jul 2002 12:08:22 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp AT delorie DOT com Hi. I've encountered a problem, that I'm not sure is related to djgpp or windows itself. The problem is when you redirect from stdin to stdout several times. I've been able to narrow it down to this: Source: #include int main() { char textline[1024]; while(gets(textline)) { printf(textline); } fflush (stdout); } Now, the program does nothing of interest, however it will encounter the problem. prog.exe < somefile.txt This works. (Echo's the text) prog.exe < somefile.txt | prog.exe This works. prog.exe < somefile.txt | prog.exe | prog.exe This works on Win 2k, but hangs on Windows XP prog.exe < somefile.txt | prog.exe | prog.exe | prog.exe This works on Win 2k, but hangs on Windows XP prog.exe < somefile.txt | prog.exe | prog.exe | prog.exe | prog.exe Hangs on both win 2k and xp. For some reason it might work the first the I run the program (the commandlines), but it will fail the second time. I'm not even sure the problem is in djgpp, could as well be windows. However I have not been able to test the program on win9x. Any help or idea is appreciated. Geir