Locked files
-
I was wondering if there was a way to get the name/id of a process that is locking a file. When I run try to open a FileStream and get the annoying "The process cannot access the file 'somefile' because it is being used by another process." message, can I get witch process is using that file or is that out of reach in C#?
http://johanmartensson.se - Home of MPEG4Watcher
-
I was wondering if there was a way to get the name/id of a process that is locking a file. When I run try to open a FileStream and get the annoying "The process cannot access the file 'somefile' because it is being used by another process." message, can I get witch process is using that file or is that out of reach in C#?
http://johanmartensson.se - Home of MPEG4Watcher
I don't know how to do it in c# but here is c++ way: Deleting Locked Files[^] You can use P/Invoke and use it in a .NET application
#region signature my articles #endregion