473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

finding which process locks a file

Hi to all,

I have a file that is locked and I get the message "file is locked by
another user or process". How can I show which process has it locked (i.e.
need the pid and the process name and path).

Sham.
May 31 '07 #1
4 6020
Any clues? I posted this over a week ago and was hoping there was an easy
solution.

Sham.

"Shamresh" <sh******@inspirationmatters.comwrote in message
news:Ox**************@TK2MSFTNGP04.phx.gbl...
Hi to all,

I have a file that is locked and I get the message "file is locked by
another user or process". How can I show which process has it locked (i.e.
need the pid and the process name and path).

Sham.

Jun 4 '07 #2
On Mon, 04 Jun 2007 09:37:06 -0700, Shamresh
<sh******@inspirationmatters.comwrote:
Any clues? I posted this over a week ago and was hoping there was an easy
solution.
There is no easy solution. If you use Google to search this newsgroup for
previous questions identical to yours, you'll find some not-so-easy
solutions.

Basically, this is not information you can get via .NET. It's not even
all that easy to get from the native Windows API.

Pete
Jun 4 '07 #3
On Jun 4, 9:44 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Mon, 04 Jun 2007 09:37:06 -0700, Shamresh

<shamr...@inspirationmatters.comwrote:
Any clues? I posted this over a week ago and was hoping there was an easy
solution.

There is no easy solution. If you use Google to search this newsgroup for
previous questions identical to yours, you'll find some not-so-easy
solutions.

Basically, this is not information you can get via .NET. It's not even
all that easy to get from the native Windows API.

Pete
Try using FileMonitor utility to check which process accessed the file
http://www.microsoft.com/technet/sys...k/Filemon.mspx
Don't have any other idea. I've faced some problem while using IO
streams. Usually this happens when you opened a stream and it was not
closed/disposed properly.

Jun 4 '07 #4
On Jun 4, 10:36 pm, Aneesh P <anees...@gmail.comwrote:
On Jun 4, 9:44 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Mon, 04 Jun 2007 09:37:06 -0700, Shamresh
<shamr...@inspirationmatters.comwrote:
Any clues? I posted this over a week ago and was hoping there was an easy
solution.
There is no easy solution. If you use Google to search this newsgroup for
previous questions identical to yours, you'll find some not-so-easy
solutions.
Basically, this is not information you can get via .NET. It's not even
all that easy to get from the native Windows API.
Pete

Try using FileMonitor utility to check which process accessed the filehttp://www.microsoft.com/technet/sysinternals/FileAndDisk/Filemon.mspx
Don't have any other idea. I've faced some problem while using IO
streams. Usually this happens when you opened a stream and it was not
closed/disposed properly.
Forgot to mention, you can use filter in FileMon, to see access/read/
write for a particular file(the file being locked up),

Jun 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: A. Tillman | last post by:
We are having a really big problem with a zombie process/transaction that is blocking other processes. When looking at Lock/ProcessID under Current Activity I see a bunch of processes that are...
4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
1
by: Mike | last post by:
Ok, why does the db2 diag log not reporting deadlocks and escalations any longer? Something I am doing wrong here? Also in the db2diag.log what is the difference between and TID and a PID. If I try...
6
by: m | last post by:
Hello, I have an application that processes thousands of files each day. The filenames and various related file information is retrieved, related filenames are associate and placed in a linked...
4
by: Earth Worm Jim | last post by:
I am using VS.Net 2003 on Windows 2003 Server (standard edition) and I am getting "The process cannot access the file because it is being used by another process" on DLL's in a VS.Net solution. ...
1
by: ABCL | last post by:
Hi All, I am working on the situation where 2 different Process/Application(.net) tries to open file at the same time....Or one process is updating the file and another process tries to access...
1
by: mfanny | last post by:
Hi, We have SQL 7 running on Windows 2000 Server. For some reason we are unable to view Locks / Process ID from workstations running Windows XP SP2 with Enterprise Manager. Nothing shows up in...
3
by: eugenet | last post by:
Hello, This is probably a newbie question. In my C# program, when I try to delete a file, I get an exception that the file is locked by another process. I would like to terminate the process...
7
by: atlaste | last post by:
Hi, I have two different things I'd like to discuss here. Both are about cross-process synchronization of shared resources. The resources that are shared are: (1) an object writing to a file and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.