If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Test a file to see if it's open

I want to act upon files that are created by others _after_ they have closed
the file.

Files are created by an app that allows user saves at will. It is possible
to do one or more interim saves, therefore, before being "finished." Users
save the file across a network to the box were my app resides, so they are
remote but the file is local.

I only want to pick up "finished" (closed) files. I thought I could do it
by using CreateFile, setting the dwShareMode parameter to 0. However, it
doesn't appear to work that way in testing; I can open the file and it still
gets acted upon (even when opening the file locally).

Can anyone suggest a way to test to see if another user/app (across a
network connection) currently has a file open--or the reflexive, test to see
if I have the file (on the local box) open exclusively?