What app is locking a file?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

What app is locking a file?

Post by zer0 »

With respect to...

Code: Select all

v9.11.0001 - 2010-05-21 13:08
   * List: Inline-rename now checks whether the item to be renamed is
      in use. If yes, you get the message "The item cannot be renamed
      because it is currently opened by another application."
      Note that the check works only for files, not for folders.
can XY tell what application a file is open in? It would be hugely valuable as a lot of people are pulling their hair out when they get a similar message from Explorer that doesn't tell them the actual app :evil: There are apps like Unlocker and LockHunter that can retrieve such info via whatever methods they use. Also, what if one is doing a batch rename and multiple files are open in multiple apps?
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

admin
Site Admin
Posts: 64880
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: What app is locking a file?

Post by admin »

zer0 wrote:With respect to...

Code: Select all

v9.11.0001 - 2010-05-21 13:08
   * List: Inline-rename now checks whether the item to be renamed is
      in use. If yes, you get the message "The item cannot be renamed
      because it is currently opened by another application."
      Note that the check works only for files, not for folders.
can XY tell what application a file is open in? It would be hugely valuable as a lot of people are pulling their hair out when they get a similar message from Explorer that doesn't tell them the actual app :evil: There are apps like Unlocker and LockHunter that can retrieve such info via whatever methods they use. Also, what if one is doing a batch rename and multiple files are open in multiple apps?
I tried to find out exactly that yesterday but failed. :( I could not find any hint on how that could be done programmatically.

Jerry
Posts: 828
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: What app is locking a file?

Post by Jerry »

I heartily recommend using the Sysinternals Process Explorer to view processes and other great stuff. It has a find feature that will find any process that has a file or directory handle open.
http://technet.microsoft.com/en-us/sysi ... 96653.aspx

They also have a command-line utility that does just this function only:
http://technet.microsoft.com/en-us/sysi ... 96655.aspx
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: What app is locking a file?

Post by zer0 »

Starting with Vista, an API called IFileIsInUse has been introduced to allow developers to determine what application is using a particular file. I would like for XYplorer to make use of this API and display information about the application that has a handle on the file in question.

Once implemented, the dialogue window would then be changed to "This item is opened in <insert name of the program here>". This would make it more informative and would allow me to go directly to the relevant application and close it.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

admin
Site Admin
Posts: 64880
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: What app is locking a file?

Post by admin »

zer0 wrote:Starting with Vista, an API called IFileIsInUse has been introduced to allow developers to determine what application is using a particular file. I would like for XYplorer to make use of this API and display information about the application that has a handle on the file in question.

Once implemented, the dialogue window would then be changed to "This item is opened in <insert name of the program here>". This would make it more informative and would allow me to go directly to the relevant application and close it.
Well, when I'm bored... :wink:

eil
Posts: 1815
Joined: 13 Jan 2011 19:44

Re: What app is locking a file?

Post by eil »

zer0, why not just use mentioned Unlocker? besides, not all people use Vista or 7, so such implementations are not only "partial" but yet somewhat "out of XY business" 8)
Win 7 SP1 x64 100% 1366x768|1900x1080

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: What app is locking a file?

Post by zer0 »

eil wrote:why not just use mentioned Unlocker?...
Because I would rather not use a 3rd-party tool if said functionality can be implemented natively using an API created for such purpose.
eil wrote:...besides, not all people use Vista or 7, so such implementations are not only "partial" but yet somewhat "out of XY business" 8)
Using the latest figures of our forum poll, 61% of users are running Vista or Windows 7. How accurately that extrapolates to the wider userbase is unknown to me. I appreciate that not all users would be able to take advantage of this useful functionality -- this is outside of my control. Further, I do not see it as a valid reason to deny those who do not use at least a decade-old OS.

As for "out of XY business", I strongly disagree. XY's business is file management. Aforementioned API would enhance its ability to manage files by providing relevant, actionable information that would help me manage files easier.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

eil
Posts: 1815
Joined: 13 Jan 2011 19:44

Re: What app is locking a file?

Post by eil »

well, your arguments are reasonable. i don't like it but i agree with most of them :wink:
except about 3rd party programs(XY is 3rd one and way better than native) and bit about XP('cause it still beats 7 for reasons=not just IMO and can't be helped). 8)
Win 7 SP1 x64 100% 1366x768|1900x1080

ethanpil
Posts: 40
Joined: 09 Sep 2009 21:45

Re: What app is locking a file?

Post by ethanpil »

+1 on this idea. I could use this everyday. It will save many collisions between my fists and my keyboard. :)

PeterH
Posts: 2826
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: What app is locking a file?

Post by PeterH »

I also think that it would be worth for a good file manager to show me what's locking a file, instead of letting me search.

(And OK: maybe a right-click function "Show Locks"? :oops: )

Edit: I should say: I'm starting to play with "7"...

Adequat
Posts: 95
Joined: 20 Jul 2007 12:03

Re: What app is locking a file?

Post by Adequat »

+1, I often come to that blocking situation.

jcadbiz
Posts: 15
Joined: 29 Jun 2011 01:11
Location: California Coast
Contact:

Re: ' ' about unlocker

Post by jcadbiz »

Typically there are more than one and sometimes NONE reported blocking a file - and unlocker can delete or rename - there's quite a bit of code there. Unlocker will work on a parent directory and scoop all the files. Seeing that functionality seems natural to a browser - shouldn't MS implement it first? :roll:

Unlocker has an automatic mode where it just pops up. It works on my XP system but I haven't seen it work yet on my Vista. That's lovely.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: ' ' about unlocker

Post by zer0 »

jcadbiz wrote:Seeing that functionality seems natural to a browser - shouldn't MS implement it first? :roll:
It's one of the most wished for features, but for now they just provide an API for 3rd party application developers to hook into.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

eil
Posts: 1815
Joined: 13 Jan 2011 19:44

Re: What app is locking a file?

Post by eil »

and 3rd party programs do it good :P i, personally don't believe MS will do anything as good as Unlocker. besides, this little prog has one more much useful ability- it also unlocks flash drives, when "safe disconnect" says it's blocked and it can do nothing.
Win 7 SP1 x64 100% 1366x768|1900x1080

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: What app is locking a file?

Post by zer0 »

eil wrote:and 3rd party programs do it good :P
The one 3rd party program that I want to see make use of this API is XYplorer.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Post Reply