什么是相当于为Posix的popen()在Win32 API? [英] What is the equivalent to Posix popen() in the Win32 API?
问题描述
有没有一个大概相当于在Linux / Unix stdio.h中的popen()函数在Win32 API?如果是这样,我在哪里可以找到它?
Is there a rough equivalent to the Linux/Unix stdio.h popen() function in the Win32 API? If so, where can I find it?
编辑:我需要知道这在D标准库修补遗漏。任何答案必须使用仅标准的Win32 API,没有具体的MSVC的函数。另外,我倒是preFER一些可怕的不是低层次的,如果它存在。
I need to know this to patch an omission in the D standard library. Any answer must use only standard Win32 API, no MSVC-specific functions. Also, I'd prefer something that's not horribly low-level, if it exists.
推荐答案
MSDN说明如何做的popen不使用Windows API中的Pipe处理继承。 这里的它提供了一个证据充分的例子。它的方式更低电平比由Jason链接的运行时库中找到的 _popen
的功能,但使用Win32 API只。
MSDN explains how you do what popen does using the Windows API in Pipe Handle Inheritance . Here it provides a well-documented example. It's way more low-level than the _popen
function found in the runtime library linked by Jason, but uses the Win32 API exclusively.
这篇关于什么是相当于为Posix的popen()在Win32 API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!