We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The example in mainpage.html
const pstreams::pmode mode = pstreams::pstdout|pstreams::pstderr; ipstream child("echo OUT1; sleep 1; echo ERR >&2; sleep 1; echo OUT2", mode); char buf[1024]; std::streamsize n; bool finished[2] = { false, false }; while (!finished[0] || !finished[1]) { if (!finished[0]) { while ((n = child.err().readsome(buf, sizeof(buf))) > 0) std::cerr.write(buf, n).flush(); if (child.eof()) { finished[0] = true; if (!finished[1]) child.clear(); } } if (!finished[1]) { while ((n = child.out().readsome(buf, sizeof(buf))) > 0) std::cout.write(buf, n).flush(); if (child.eof()) { finished[1] = true; if (!finished[0]) child.clear(); } } }
Can anyone point me to understand how to change it to write a std::string to stdin before start looping for stdout/stderr output? Thanks.
The text was updated successfully, but these errors were encountered:
Resolved with write() and sync(), sorry.
Sorry, something went wrong.
No branches or pull requests
The example in mainpage.html
Can anyone point me to understand how to change it to write a std::string to stdin before start looping for stdout/stderr output? Thanks.
The text was updated successfully, but these errors were encountered: