Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: How to clear named pipe to just have one line

by techman2006 (Beadle)
on Feb 08, 2014 at 13:22 UTC ( #1074010=note: print w/replies, xml ) Need Help??


in reply to Re: How to clear named pipe to just have one line
in thread How to clear named pipe to just have one line

Basically there are two unrelated processes say P1 (A C program) and P2(a Perl script). Now P2 is running and is output some data to stdout. Now P1 will come at regular interval to read such data.

As these are unrelated processes. So I was thinking to use named pipe. Now process P1 want to read only one line which is output from process P2. As it continuously generates output we want to truncate the data so that process P1 don't read redundant data.

Any thoughts how to solve this problem.

  • Comment on Re^2: How to clear named pipe to just have one line

Replies are listed 'Best First'.
Re^3: How to clear named pipe to just have one line
by moritz (Cardinal) on Feb 08, 2014 at 13:29 UTC

      As process P1 is an server which is multithread and one of thread will try to read status from process P2. So process P1 will not have way to capture stdout of process P2.

        Being multithreaded has nothing to do with the ability to capture stdout.

        Aslo I don't understand how a named pipe would have helped.

        Maybe try to start from the beginning, explain what's actually going on, and what you want to achieve?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (1)
As of 2023-03-30 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (74 votes). Check out past polls.

    Notices?