Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Handling program output in real time

by etcshadow (Priest)
on Nov 10, 2003 at 19:56 UTC ( [id://305946]=note: print w/replies, xml ) Need Help??


in reply to Re: Handling program output in real time
in thread Handling program output in real time

This doesn't really address his issue, though, as writing to a FIFO is going to have the exact same buffering behavior (line based or block based) as writing to a pipe would.

Basically, as other users mentioned, perl internally does something along the lines of (psuedo-code):

if (-t STDOUT) { line_buffer STDOUT; } else { block_buffer STDOUT; }
Not that FIFOs aren't useful, they just don't have anything to do with this particular problem. If, for example, he had no control over the output of this "blackbox" and it wanted to write to a named file... well then a FIFO would be really useful, because he could replace the named file with a named pipe (FIFO), and all would be cool. Here, though, the guy's already got an anonymous pipe... so swapping it with a named-pipe isn't gonna really change anything.

------------
:Wq
Not an editor command: Wq

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-16 06:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found