How about using OpenFile() with OF_SHARE_EXCLUSIVE? I think it is better
since using CreateFile, if successful, I have to delete the file, and my
purpose is only to check whether some file is opened (used) or not.
=========================================================
Hi Victor,
How about using OpenFile() with OF_SHARE_EXCLUSIVE? If successful, I need to
close the file.
regards,
=========================================================
Hi George,
Please *read the complete* documentation: you can call CreateFile in a way
that it will only open a file if it already exists, so that no file is
created.
=========================================================
Thanks SvenC,
For CreateFile, it only has option OPEN_EXISTING to check whether a file is
existing or not, but no exclusive mode checking to see whether the existing
file is used (opened) by any other thread/process.
/en-us/library/
Any comments?
=========================================================
Hi George,
Pass 0 to dwShareMode and you disallow sharing.
--
SvenC
=========================================================
相关文章
- springboot 如何使用restTemplate下载文件流到本地
- raid-如何使用smart检查raid磁盘健康状态
- 如何使用visual studio 将.cpp文件生成.exe文件
- 如何使用Android Studio在安卓平台对Unity开发的应用进行性能检查?
- Linux ftp命令教程:如何使用ftp命令进行文件传输(附实例详解和注意事项)
- 如何使用Notepad++上格式化XML文件
- 如何在 MySQL 中使用命令行导入 SQL 文件?
- bin文件用cad打开_DWG图纸文件用CAD怎么打开?CAD软件如何使用?
- 如何快捷地使用ChemBio 3D检查结构信息
- logback框架使用误区 如何将所有包的ERROR级别日志集中打印到一个日志文件中