[Gllug] pipes and C++

salsaman at xs4all.nl salsaman at xs4all.nl
Sun Sep 12 22:54:46 UTC 2010


On Sun, September 12, 2010 23:13, Adrian McMenamin wrote:
> On Mon, 2010-09-13 at 09:09 +1200, David L Neil wrote:
>> Adrian McMenamin wrote:
>> > I have been chaining three C++ programs I have written together -
>> > working on the principle that each should do one thing - so
>> > A - generates some xml
>> > B - processes said xml
>> > C - outputs graphics
>> > A | B | C
>> > All works well - but now I want to have them repeat this every few
>> > seconds ie for every three seconds
>> > A --r 3 | B --r 3 | C --r 3
>> > But while it is easy to get the first program to churn out the xml I
>> > cannot work out how to get the second element in the chain to
>> recognise
>> > the end of the output - (I am guessing that previously B didn't really
>> > start until A was dead?)
>>
>> create ABC.sh as
>> A | B | C
>>
>> now ABC.sh --r 3   ???
>
> The final one of the applications is a heavy weight X11 thing and I want
> it to redraw the display rather than restart
>
> --
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
>
>

I think you could do it with fifos, e.g.

mkfifo fifo1
mkfifo fifo2

A > fifo1
B > fifo2 < fifo1
C < fifo2


Salsaman.


-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list