The UNIX and Linux Forums
>
Top Forums
>
High Level Programming
How to clear the content of a pipe (STDIN) after it is written to another program?
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Portal
Register
Rules & FAQ
Contribute
Members List
Arcade
Search
Today's Posts
Mark Forums Read
Thread
:
How to clear the content of a pipe (STDIN) after it is written to another program?
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
05-14-2008
shamrock
Registered User
Join Date: Oct 2007
Location: USA
Posts: 462
The process needs to read() data off the pipe in order to clear it otherwise it blocks and stays in the pipe. Invoke read() after exec'ing program B in the child process.
shamrock
View Public Profile
Find all posts by shamrock