流程是,我的程序读另外一个程序产生的文件,然后根据这个文件的内容作一些事。
可是现在的问题是,我不知道如何判断这个文件是否被另外的程序处理完毕,我现在只能让我的程序sleep一段时间,这样做实在不是什么好办法,我查了一下相关的函数库,可是实在找不到这方面的资料,请高手帮忙,如何解决不同进程间文件读写的问题。
可是现在的问题是,我不知道如何判断这个文件是否被另外的程序处理完毕,我现在只能让我的程序sleep一段时间,这样做实在不是什么好办法,我查了一下相关的函数库,可是实在找不到这方面的资料,请高手帮忙,如何解决不同进程间文件读写的问题。
解决方案 »
- 纯新手问几个幼稚小问题。
- 如何快速读取GIS中指定数据?
- 今天找到一工作(一家电子公司),犹豫是否值得去,现在职的(搞C++开发的)请教哥们!
- 请问,我在对话框窗体里面加了个RichEdit 控件,为什么build通过之后,运行的时候却看不到窗体阿?(20分)!!!
- 该不该相信微软的日历
- 关于网页内ActiveX Control与数据库连接的问题
- ODBC连接数据库时,抛出内存异常,请问是怎么回事?
- 怎样设置工程(内详)
- 各位兄弟请进来看看帮帮忙!!建议好的给分!!
- DBGrid的用法?奉送100分(特急,用于毕业设计)
- 工程上的问题,请学力学的兄弟帮一下!
- 请问游戏登陆器的窗口化是怎么实现的?
一楼老大,能否具体讲讲
二楼老大,我现在也这么做的,不过觉得有点不是很好,没别的好方法了么
LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile
);dwShareMode
[in] Sharing mode of the object. You cannot request a sharing mode that conflicts with the access mode specified in a previous open request whose handle is still open.
If this parameter is zero and CreateFile succeeds, the object cannot be shared and cannot be opened again until the handle is closed. For more information about sharing violations, see the Res section.To enable other processes to share the object while your process has it open, use a combination of one or more of the following values to specify the type of access they can request when they open the object. These sharing options remain in effect until you close the handle to the object.Value Meaning
FILE_SHARE_DELETE Enables subsequent open operations on the object to request delete access. Otherwise, other processes cannot open the object if they request delete access.
If the object has already been opened with delete access, the sharing mode must include this flag.
Windows Me/98/95: This flag is not supported.
FILE_SHARE_READ Enables subsequent open operations on the object to request read access. Otherwise, other processes cannot open the object if they request read access.
If the object has already been opened with read access, the sharing mode must include this flag.
FILE_SHARE_WRITE Enables subsequent open operations on the object to request write access. Otherwise, other processes cannot open the object if they request write access.
If the object has already been opened with write access, the sharing mode must include this flag.
opentuxedo(开缝的燕尾服)所说
WaitForSingleObject,
具体代码WWW.VCKBASE.COM上有