Dea*_*ing 16
为什么不简单地将文件写入磁盘?如果写入磁盘太慢,可以将FILE_ATTRIBUTE_TEMPORARY标志传递给CreateFile以将数据保存在缓存中(并避免将其写入物理设备).
有时候明显的解决方案是最好的......
您可以使用以下函数在 C 中完成此popen()操作:
FILE *f = popen("program args", "w");
// write your output to f here using stdio
pclose(f);
Run Code Online (Sandbox Code Playgroud)
如果您的外部程序从 读取其输入,则这是可能的stdin。