dave_usa has asked for the wisdom of the Perl Monks concerning the following question:
I have the following problem. I have a script running on Windows machine that forks (creates a thread) and the parent thread calls system() to execute a process. After it forks, the parent thread redirects STDOUT to a file and the child reads it. Before the system() call is made, another redirection takes place, so the result of the process is saved to another file. When system() finishes the STDOUT is redirected back to the file.
Now, this was working correctly with the Perl version 5.6.1. However, it is not working with Perl 5.8. The created process prints to the console (typical STDOUT) of the parent process. I believe that it is has to do something with PerlIO. I have read somewhere, but I can't find it now, that one can redirect the underlying C filehandle instead of the Perl filehandle, STDOUT in this case.
Any ideas?
--Dave
Edit by tye, preserve formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fork system() STDOUT redirection on WindowsXP
by Anonymous Monk on Jun 25, 2003 at 22:37 UTC | |
by dave_usa (Novice) on Jun 25, 2003 at 23:41 UTC | |
|
Re: fork system() STDOUT redirection on WindowsXP
by BrowserUk (Patriarch) on Jun 25, 2003 at 21:48 UTC | |
by dave_usa (Novice) on Jun 25, 2003 at 21:58 UTC | |
by BrowserUk (Patriarch) on Jun 25, 2003 at 22:06 UTC | |
by dave_usa (Novice) on Jun 25, 2003 at 22:24 UTC | |
by tilly (Archbishop) on Jun 26, 2003 at 06:58 UTC | |
|