How to check whether a file is already open
C / C++ / MFC
3
Posts
3
Posters
0
Views
1
Watching
-
Hi, Can anyone tell me how to find if a file is already open.This is to prevent two instances of the same file. Thanks. Deepak Samuel. Deepak Samuel.
-
Hi, Can anyone tell me how to find if a file is already open.This is to prevent two instances of the same file. Thanks. Deepak Samuel. Deepak Samuel.
Try to open the file again. If it is opened elsewhere, you'll get an appropriate error.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
Hi, Can anyone tell me how to find if a file is already open.This is to prevent two instances of the same file. Thanks. Deepak Samuel. Deepak Samuel.
I would add to David's comment - open the file with the EXCLUSIVE mode !! 'G'