使用 stdin stdout 和 stderr 启动 exe/进程? [英] launch an exe/process with stdin stdout and stderr?

查看:26
本文介绍了使用 stdin stdout 和 stderr 启动 exe/进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 C++,我如何使用 stdin stdout 和 stderr 启动 exe/进程?我知道如何在 .NET 中执行此操作,我记得过去使用过 popen 但 popen 似乎允许 stdin 或 stdout 不是两者都允许,也不是全部 3.

With C++ how do i launch an exe/process with stdin stdout and stderr? I know how to do this in .NET and i remember using popen in the past but popen seems to allow stdin OR stdout not both and not all 3.

我需要在 Windows 上使用它,但欢迎使用 linux 解决方案,因为我将来会在同一个项目中使用它.

I need this for windows but a linux solution is welcome as i'll need it for the same project in the future.

推荐答案

可移植的解决方案是 boost.process

(注意:这已被提议为 Boost 库,并在相同的许可条款下发布,但未正式接受.另见 Boost.Process 在哪里?)

(Note: this has been proposed as a Boost library, and released under the same license terms, but not officially accepted. See also Where is Boost.Process?)

这篇关于使用 stdin stdout 和 stderr 启动 exe/进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆