Mail Archives: djgpp/2002/07/03/07:19:09
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 <stdio.h>
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
- Raw text -