Why doesn't this code work in Linux (Ubuntu) ? I'm trying to run "ls -al" (the Linux ls command) #include #include #include #include #include #include #include <string> #include <istream> #include <cstdlib> #include <iostream> int main(int argc, char* argv[]) { bp::pipe p = bp::create_pipe(); { bio::file_descriptor_sink sink(p.sink, bio::close_handle); boost::system::error_code ec; bp::execute( bpi::run_exe("ls"), bpi::set_cmd_line(" -al"), bpi::bind_stdout(sink), bpi::set_on_error(ec) ); // BOOST_CHECK(!ec); } bio::file_descriptor_source source(p.source, bio::close_handle); bio::streambio::file_descriptor_source is(source); std::string s; is >> s; cout << "here " << s << endl; }
Shubha D. Ramanishubharamani@gmail.com
shubharamani@yahoo.com
On Wednesday, August 31, 2016 11:03 AM, Shubha Ramani wrote:
on Linux.
This code hangs at getline. I replaced "test.exe" with "ls". Why doesn't it work ?
https://github.com/BorisSchaeling/boost-process/blob/master/libs/process/exa...
Shubha D. Ramanishubharamani@gmail.com
shubharamani@yahoo.com