Test a file to see if it's open
I want to act upon files that are created by others _after_ they have closed
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?
My current call:
hFile = CreateFile(sFName, GENERIC_READ, 0&, 0&, _
OPEN_EXISTING, 0&, 0&)
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL