Boost logo

Boost :

Subject: [boost] How to bind program termination with end-of-stream in Boost.Process 0.5?
From: alfC (alfredo.correa_at_[hidden])
Date: 2012-09-08 20:00:06


Hi,

 I have a simple question about the latest Boost.Process 0.5 library. Namely
how to How to bind program termination with end-of-stream in Boost.Process
0.5?

For example, in this example
http://www.highscore.de/boost/process0.5/boost_process/tutorial.html#boost_process.tutorial.synchronous_i_o

One can make a look to read the output of the process until the program
finishes, but the stream is not invalid after program termination.
   ...
    while(std::getline(is, s)){ // is is an stream associated with a process
(e.g. '/usr/bin/ls')
        std::cout << "read: " << s << std::endl;
    }
    std::clog << "end" << std::endl; // never reach
   ...

I originally posted the question in
http://stackoverflow.com/questions/12329065/how-to-bind-program-termination-with-end-of-stream-in-boost-process-0-5
but now I think it can be overlooked there.

Since now there seems to be extra layers (Boost.Streams) it may be that I
don't know how to set up the file_descriptor_source, etc. BTW, the solution
to this question can be used to improve the example code in
http://www.highscore.de/boost/process0.5/boost_process/tutorial.html

Thanks,
Alfredo

--
View this message in context: http://boost.2283326.n4.nabble.com/How-to-bind-program-termination-with-end-of-stream-in-Boost-Process-0-5-tp4635497.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk