Click to See Complete Forum and Search --> : check file opened or not?


George2
April 2nd, 2008, 09:54 AM
Hello everyone,


On Windows platform, which API could be used to check whether a file is opened (either by other thread or process or even the same thread) or not?

C++ is fine.


thanks in advance,
George

golanshahar
April 2nd, 2008, 02:51 PM
Look at ::OpenFile() (http://msdn2.microsoft.com/en-us/library/aa365430.aspx) with OF_SHARE_EXCLUSIVE.

Cheers

George2
April 3rd, 2008, 02:19 AM
Thanks golanshahar,


Question answered.

Look at ::OpenFile() (http://msdn2.microsoft.com/en-us/library/aa365430.aspx) with OF_SHARE_EXCLUSIVE.

Cheers


regards,
George

golanshahar
April 3rd, 2008, 04:40 PM
You are welcome :wave:

Cheers