OfficeLinebacker has asked for the wisdom of the Perl Monks concerning the following question:
So I have been tilting at the windmill of handling STDOUT and STDERR of a child
synchronously, yet separately. I work in a Linux environment (RedHat 3 and 4 and perl 5.8.5).
I've resigned myself to getting halfway results with
sporadic attempts at refining my technique. I won't repeat myself here, but this node:
Re: Synchronizing STDERR and STDOUT
explains the current status of my efforts.
Here's an example of some output from the example child program:
As you can see in the code, autoflushing is turned on (in both child and parent) and the child should think it's connected to a tty.<snip> <span id='stderr'>1</span> 2 <span id='stderr'>3</span> 4 <span id='stderr'>5</span> 6 8 10 12 14 16 18 <span id='stderr'>7 9 11 13 15 17 19 21 23 25 27 29 31 33 35</span> 20 <snip> 58 <span id='stderr'>37 39 <snip> 73</span> 60 62 <you get the picture>
Upon reading the whole thread that the above node is in, I found out about PerlIO and enabled logging for a run of the program.
I glanced through perlio.log and I found the following line:
/opt/perl/lib/site_perl/5.8.5/IPC/Run.pm:2613 Cannot flush f=0x805defc
here is line 2613 in my version of Run.pm:
I am curious about where the "Cannot flush" message originated and why. Any ideas?open $s1, ">&=$self->{SYNC_WRITER_FD}" or croak "$! setting filehandle to fd SYNC_WRITER_FD" ;
Terrence
_________________________________________________________________________________
I like computer programming because it's like Legos for the mind.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question about the guts of PerlIO and IPC::Run
by blahblah (Friar) on Sep 23, 2006 at 15:12 UTC | |
by OfficeLinebacker (Chaplain) on Sep 25, 2006 at 16:13 UTC |