系统函数调用asynchron? [英] system-function call asynchron?

查看:159
本文介绍了系统函数调用asynchron?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前在codeI一个地方打电话与系统 - 呼叫。我与葡萄酒和程序用C的工作。

At one place in a code i call an external tool with the system-Call. I work with Wine and program with C.

调用是这样的:

system("blabla.exe outfile");

该命令是动态生成的改变OUTFILE。几行之后,我尝试打开与生成的文件的fopen ,但的fopen 收益 NULL

如果我改变调用下面的一切工作:

If i change the call to the following everything works:

system("blabla.exe outfile");
Sleep(2000);

但我不喜欢间隔2秒......而这种解决方案是非常糟糕的。
我觉得系统 - 呼叫工作SYNCHRON?因此,子过程中所有的(文件)把手应关闭的系统后 - 呼叫,没有?我有点糊涂了这一点。

But i don't like to wait 2 seconds... And this solution is very bad. I think the system-Call works synchron? So the sub-process an all its (File-)Handles should be closed after the system-Call, not? I'm a bit confused about this.

感谢

推荐答案

系统调用是同步的,根据执行结束后,将返回手册页。我怀疑有一些酒冲洗文件句柄。

system call is synchronous, according to the man page it returns after the execution ends. I suspect there's something with wine flushing file handles.

这篇关于系统函数调用asynchron?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆