Title: RE: [msvc] Open files?

At 04/25/2003 03:21 PM, Ehsan Akhgari wrote:

 >> I've just spent a small amount of time looking as well... I'm
 >> afraid it doesn't look like you can find out. I was wondering
 >> if you could walk the process list to find out what handles
 >> it had open, and then query each handle to see if it referred
 >> to the file in question, thus building a list of handles
 >> referring to your file (thus, the number of times it has bee
 >> opened, ignoring duplicate handles)... but I can't seem to
 >> see any functions for doing that.
 >
 >Unfortunately I'm being on a fresh copy of Windows, and I'm afraid I
 >won't be able to install the MSDN collection until some days to come
 >(since I lack the enough time).  What I know without having to look at
 >the MSDN is that this is possible.  VS.NET supports this same feature
 >using its undocumented $handles switch (to see it in action, start
 >debugging an app in VC7, and type $handles in the Watch window, and
 >change its value to 0, and then look at the output window.)  I suspect
 >this functionality can be accessed using either the PSAPI or the
 >ToolHelp set of APIs, though this is merely a guess.

That sounds like it would only know about local processes.

What about a file on a network drive that multiple people are accessing?

Phil Daley          < AutoDesk >
http://personal.monad.net/~p_daley

Reply via email to