Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Listening to a child for a while, then passing its output along

by crouchingpenguin (Priest)
on May 21, 2003 at 16:54 UTC ( [id://259791]=note: print w/replies, xml ) Need Help??


in reply to Listening to a child for a while, then passing its output along

Check out Bidirectional Communication with ... (part of perlipc).

cp
----
"Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic."

  • Comment on Re: Listening to a child for a while, then passing its output along

Replies are listed 'Best First'.
Re: Re: Listening to a child for a while, then passing its output along
by antifun (Sexton) on May 21, 2003 at 18:21 UTC

    This doesn't answer any of my questions, sadly. Here's a short version of them, restated:

    • Is there any way to "merge" file descriptors without doing any manual copying of data? That is, can you do something like
      open(CHILD_STDOUT, ">&STDOUT"); open(CHILD_STDERR, ">&STDERR");
      without screwing up the the real filehandles? (This would effect a passthrough of the child's stdout and stderr.)
    • What is the best (or a good) way to drop into an existing Perl/Tk program a routine that echoes child output as described above? Fileevents will probably work for this, but does anyone have any other ideas?

    The link you gave tells me what I already know how to do -- open a child and listen to its output. What I need to do is stop listening at some point, while letting the child continue, and echoing whatever else it says after that point to whoever might be listening to my STDOUT or STDERR.


    ---
    "I hate it when I think myself into a corner."
    Matt Mitchell

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://259791]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-26 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found