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
std::process::ChildStdout
I'm working with std::process::Child::try_wait and std::process::ChildStdout. Here is an example,
std::process::Child::try_wait
let mut child = cmd.spawn().unwrap(); loop { let mut buf = [0 as u8; 4096]; if let Some(ref stream) = child.stdout { stream.read(&mut buf).unwrap(); // Will it block? } match child.try_wait() { // something here ... } }
I could not find stream.read(&mut buf) would block or not in API document. I test that simple code on Linux and it didn't blocking. So,
stream.read(&mut buf)
Please help me. Thanks very much!
The text was updated successfully, but these errors were encountered:
Yes on all platforms all I/O in libstd is blocking by default, if not it's a bug!
Sorry, something went wrong.
This means that we should make it clear that std::process:ChildStdout.read is nonblocking in documents, right?
std::process:ChildStdout.read
Thank you for continually improving this amazing language!
Did you mean blocking as opposed to nonblocking? If so, indeed!
Ok, you are right, it's blocking but not nonblocking. Thank you!
No branches or pull requests
I'm working with
std::process::Child::try_wait
andstd::process::ChildStdout
. Here is an example,I could not find
stream.read(&mut buf)
would block or not in API document. I test that simple code on Linux and it didn't blocking. So,Please help me. Thanks very much!
The text was updated successfully, but these errors were encountered: