gpt4 book ai didi

c++ - 使用 popen 写入管道仅在管道关闭时发送数据

转载 作者:太空狗 更新时间:2023-10-29 21:08:18 34 4
gpt4 key购买 nike

我正在使用 popen 打开写入管道并向应用程序发送命令。问题是命令仅在我关闭管道时发送到应用程序。

FILE * fp = open(target_app, "w");
fwrite(command, 1, command.size(), fp);
getchar(); //wait for a key, because I don't want to terminate the application
pclose(fp); // at this point, the command is sent

可能有什么问题?

最佳答案

关于c++ - 使用 popen 写入管道仅在管道关闭时发送数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3348807/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com