0

My goal is to:

Pipe stdin to stdin of child process.

Pipe stdout of child process to stdout.

Pipe stderr of chile process to stderr.

I have looked at these:

http://www.jukie.net/bart/blog/popenRWE

and

http://jineshkj.wordpress.com/2006/12/22/how-to-capture-stdin-stdout-and-stderr-of-child-program/

but am having trouble doing what I listed.

4

1 回答 1

2

如果你想将子进程的 stdin/stdout/stderr 连接到你的 stdin/stdout/stderr 你不需要做任何事情,它会自动继承它们。

请注意,这不会让您的应用程序对数据有任何访问权限——它只是直接在子流程应用程序和原始流之间进行。所以它并不是真正“包装”任何东西。

于 2013-07-10T16:53:27.000 回答