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

Re: Calling strace from a perl program

by cdarke (Prior)
on Mar 11, 2008 at 08:31 UTC ( [id://673427]=note: print w/replies, xml ) Need Help??


in reply to Calling strace from a perl program

I can't test this right now, but I suspect you are being misled by buffering. I recall that strace writes to STDERR, which is normally non-buffered. However you are redirecting it to STDOUT (which you have to do to use the pipe) which is buffered. $|=1;before the open is worth a try.

Replies are listed 'Best First'.
Re^2: Calling strace from a perl program
by ikegami (Patriarch) on Mar 11, 2008 at 21:56 UTC

    For starters, $|=1; in the Perl program won't affect any buffering strace might do on its output. The pipe to which strace writes a completely independent file handle from the terminal (or whatever) the Perl script writes to. Furthermore, a variable in one process won't affect a library in a different process.

    Secondly, if strace doesn't buffer what it sends to its STDERR, the output is not going to magically buffer itself if redirected.

    Unfortunately, there's no way to control whether another application buffers its output or not (unless it specifically gives you the means of doing so, of course).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-16 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found