我正在使用 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/