in reply to Re: Test whether STDOUT is connected to a file
in thread Test whether STDOUT is connected to a file
BTW, I double-checked the perldocs. The case about no redirection performed is documented there, but only for the implementation on RISC OS. About Windows, this restriction is not mentioned. Actually, the docs don't say anything at all about the Windows implementation.
However, I now found a reproducible case where the problem appear. What surprises me is the fact that it looks so simple:
Here I found that the redirection is never set up, and indeed if I do a -t STDOUT in the child process, I always get a true value. Now it puzzles me why we have in our application so many cases which work. My best guess is that Perl, in those cases, finds something which makes it create an intermediate CMD.EXE process which sets up the redirection.... system(1,'perl.exe',$0,'SLAVE1','>out1.txt','2>&1'); ...
(Just in case you wonder: The reason why I call myself recursively via $0 is that my test program distinguishes by its first parameter whether it should act as a child instead as a parent).
|
|---|