New issue
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
Add "Redirect both stdout and stderr of child process to the same fle" #349
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Just some minor suggestions below.
src/basics.md
Outdated
|
||
[![std-badge]][std] [![cat-os-badge]][cat-os] | ||
|
||
Spawns a Unix command and redirects `stdout` and `stderr` to the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The api itself is cross platform so I would avoid mentioning unix here. Would rather go with child processes.
src/basics.md
Outdated
used to reference the same file for `stdout` and `stderr`. | ||
|
||
The below recipe is equivalent to run `ls . oops &> out.txt`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we can mention that the example would be equivalent to following Unix shell command.
src/basics.md
Outdated
Spawns a Unix command and redirects `stdout` and `stderr` to the same | ||
file. It follows the same idea as [run piped external | ||
commands](#ex-run-piped-external-commands), however [`process::Stdio`] | ||
will be constructed from a file. In addition, [`File::try_clone`] is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the statement might be slightly misleading. we might want to rewrite to emphasize that process::Stdio
will write to provided File
and that File::try_clone
will duplicate the file handle ensuring the write pointer is synchronized for stderr and stdout
@budziq, PR updated with your comments. I also changed changed the equivalent Unix command from |
Well done! |
Thanks! |
fixes #345