文字列のあるプロセスをBoost-1.64.0でstdinに呼び出そうとしています。 現在のコードは次のようになります。boost :: process子のstdinを閉じる
bp::opstream inStream ;
bp::ipstream outStream;
bp::ipstream errStream;
bp::child child(
command, // the command line
bp::shell,
bp::std_out > outStream,
bp::std_err > errStream,
bp::std_in < inStream);
// read the outStream/errStream in threads
child.wait();
問題は、子の実行可能ファイルは、その標準入力のEOFを待っていることです。ここでchild.wait()は無限にぶら下がっています...
私はasio :: buffer、std_in.close()を使用しようとしました。 私が見つけた唯一のハックはinStreamを削除することでした...そしてそれは本当に信頼できるものではありません。
子プロセスを「通知」し、新しいboost :: processライブラリで標準入力を閉じるにはどうしたらよいですか?
ありがとうございます!
_ "delete()inStream" _とはどういう意味ですか?それは私にとってはあまり意味がありません。 – sehe