Is there a way to get the PID from a process that is blocking a file using C#?
views:
155answers:
1
+4
A:
I don't know whether it can be done entirely within the framework, but maybe you could call out to SysInternals' Handle.exe to do the heavy lifting here?
ZombieSheep
2009-05-03 09:53:07
+1 for using Handle.exe. It would be very difficult to implement such functionality in C#: http://stackoverflow.com/questions/177146/how-do-i-get-the-list-of-open-file-handles-by-process-in-c
Darin Dimitrov
2009-05-03 09:54:44
Thanks for the link, @Darin. Interesting!
Cerebrus
2009-05-03 10:51:57
Parsing handle output can be a simple and clean choice.Thanks :).
Ricardo
2009-05-15 12:27:27