boost-process

    1热度

    1回答

    是否可以检查进程是否终止? 我不想调用.wait(),因为它是阻塞的,我想管理超时,之后我将终止该过程。 现在我有以下代码: child c = launch(exec, args, ctx); auto timeout = boost::posix_time::seconds(3); boost::this_thread::sleep(timeout); c.terminate();

    1热度

    2回答

    当试图包含boost :: process库时,我得到2个与boost :: process pipe.hpp文件有关的错误,它处理异常。 '<function-style-cast>': cannot convert from 'initializer list' to 'boost::system::system_error' | pipe.hpp | line 129 'boost::th

    0热度

    1回答

    我使用boost :: process调用外部程序 - 外部程序通过stdin读取输入,并写入stdout和stderr。外部程序如下(预计一个参数 - 的路径用于调试的文件) #include <fstream> #include <iostream> #include <stdexcept> #include <string> #include <vector> int main(

    1热度

    1回答

    我有下面的代码,这是从我真正的代码简化,我试图做一个async_read连接到子进程的async_pipe。在孩子的过程中,我打电话给“ls”。只是一个测试,我希望我的异步阅读获得结果。它返回以下内容 $ ./a.out system:0 0 为什么会发生这种情况我找不出来?理想情况下,我想替换“ls”。有一个长时间的运行过程,我可以在线阅读async_read。 #include <bo

    0热度

    1回答

    使用Boost :: Process库启动进程,我从标准输出读取输出没有问题。但是,如果我反而想将stdout重定向到一个文件,我该如何去做呢?

    2热度

    2回答

    我试图用一个字符串调用一个进程到它的stdin,用boost-1.64.0。 当前的代码是: bp::opstream inStream ; bp::ipstream outStream; bp::ipstream errStream; bp::child child( command, // the command line bp::shell,