简体   繁体   English

如何将stderr和stdin交错到std :: process :: Command?

[英]How to interleave stderr and stdin to a std::process::Command?

Looking at the API , it doesn't look like interleaving (redirecting stdout to stderr in real time, or the other way around) is supported. 查看API ,它看起来不像交错(实时将stdout实时重定向到stderr,或者相反)。 How would I do it if needed? 如果需要我该怎么办?

What's the source of confusion? 什么是混乱的根源? You can create a Stdio object with FromRawFd::from_raw_fd , giving it a file descriptor to use as Stdio implements the trait. 您可以使用FromRawFd::from_raw_fd创建Stdio对象, FromRawFd::from_raw_fd提供一个文件描述符,以便在Stdio实现特征时使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM