Can't delete file. It's in use.

Posted:
in Mac Software edited January 2014
FWIW:

The current issue of MacWorld described an applet called 'What's Keeping Me?

$5.00 or contribution.





What's Keeping Me?

Did you ever have the problem where you can?t empty the Trash or eject a disk because something is preventing you? Usually the reason is because some application has a file open, and thus you can?t get rid of the disk or trash the file. That?s why we made What?s Keeping Me! What?s Keeping Me will identify the application that is preventing you from accomplishing your task. You can then use What's Keeping Me to quit, relaunch, or kill the problem application so you can get on with your business.



http://hamsoftengineering.com/products/wkm/wkm.html



There are other applets on that site that you may be interested in.

http://hamsoftengineering.com/products/products.html

Comments

  • Reply 1 of 9
    MarvinMarvin Posts: 14,436moderator
    It's sad that for all Apple's innovation, they can't cover basic things like when an app is in use, telling us what is using it. You can do this with the lsof command in the terminal. Takes about 5 seconds and yet they don't use it so 3rd party developers have to come up with ways to do it.



    You can do it for a disk image too when it won't eject.



    The remedies I use most often is that for trashing, using secure empty will ignore 'in use' warnings and empty anyway. For disk images, I use hdiutil eject -force.



    It looks like there's a few nice apps there and they should be much more accessible for people not familiar with terminal use.



    One big advantage I can see to an app store for the Mac is that Apple could see apps like these and if they were used a lot, then actually try and fix the issue in the OS.
  • Reply 2 of 9
    Batchmod is my favorite, because that is usually in my dock, and it's force empty trash has worked for me...



    Laters...
  • Reply 3 of 9
    hirohiro Posts: 2,663member
    Quote:
    Originally Posted by Marvin View Post


    It's sad that for all Apple's innovation, they can't cover basic things like when an app is in use, telling us what is using it. You can do this with the lsof command in the terminal. Takes about 5 seconds and yet they don't use it so 3rd party developers have to come up with ways to do it.



    You can do it for a disk image too when it won't eject.



    The remedies I use most often is that for trashing, using secure empty will ignore 'in use' warnings and empty anyway. For disk images, I use hdiutil eject -force.



    It looks like there's a few nice apps there and they should be much more accessible for people not familiar with terminal use.



    One big advantage I can see to an app store for the Mac is that Apple could see apps like these and if they were used a lot, then actually try and fix the issue in the OS.



    So I guess Apple didn't make those particular commands available?



    No wait they did? What is it you are worried about, not having your hand held?



    And you think it is heinous that it is left to a third-party.. But, but, but, when Apple does something a third party my do it is infringing on the third party market??? where is the consistency???



    Oh wait, this is the internet. Sorry. Resume irrationality.
  • Reply 4 of 9
    MarvinMarvin Posts: 14,436moderator
    Quote:
    Originally Posted by Hiro View Post


    So I guess Apple didn't make those particular commands available?



    No wait they did? What is it you are worried about, not having your hand held?



    Yeah we should get rid of the entire GUI and just have a big terminal. The whole principle of the Mac OS is about making stuff easy for you. Need to run an Apache webserver? Click one checkbox.



    It's not like these commands are secondary functions. Not being able to eject a drive properly affects usability as well as the fact it can damage a drive when an impatient user having no option left, simply yanks the plug out.



    I have seen this issue so many times and my friends have to ask me what to do. They generally know they aren't supposed to pull the drive out but they have no other option because the OS doesn't give them a route to a solution. It simply reiterates that the drive is in use. It would not be difficult for it to say, could not eject the drive because the file 'stats.xml' on the drive is being used by Excel. It can simply go through dialogs saying all the files in use and allowing the option to close - also have a 'close all' button for efficiency.



    If it can't find any items in use but the drive as flagged as in use, it should give the option to force eject the drive.



    Quote:
    Originally Posted by Hiro View Post


    And you think it is heinous that it is left to a third-party.. But, but, but, when Apple does something a third party my do it is infringing on the third party market??? where is the consistency?



    There is a clear line between them. OS-level functionality should be covered by Apple. We shouldn't need Tinkertool, Onyx and these other little apps for basic functions.
  • Reply 5 of 9
    hirohiro Posts: 2,663member
    I have to say I totally disagree with you on this one. And your histrionics/point twisting do nothing for making your point. Those little are quite apps nice, and their existence fits the niche of usage quite nicely. None of them are desperately necessary, just convenient.



    What is the worst case with your app not deleting problem? Close apps you are not using and try to delete again. Hardly a difficult to comprehend or egregiously horrible solution. Something in the trash preventing a disk from deleting, delete the rest and see what's left. Chances that it can't be figured out which app to close after that is very slim. Worst case? Log-out and back in. If the file is still stuck there is something far more serious going on that your little desired functionality has no hope of fixing. Absolute worst case ever? Restart. If the file is still stuck something BAD has happened and a novice needs experienced help.



    Now contrast that to the hue and cry of Sherlock/Spotlight vs. Watson or Dashboard vs Konfabulator. Very similar to the scenario you are advocating: put functionality in the OS where there are functioning third party solutions. You want to put some shareware authors out of business just because YOU want a GUIfied function in the OS, not as third party.



    The functionality exists. It's not hidden. Those that know the command line have it all, now. Those that eventually become knowledgeable of the command line power but don't wish to learn the invocations can easily find the apps. Those that have neither still have intuitive, safe, solutions appropriate to their experience level. This belongs to the vast class of nitpicky, already solved, non-problems.
  • Reply 6 of 9
    MarvinMarvin Posts: 14,436moderator
    Quote:
    Originally Posted by Hiro View Post


    What is the worst case with your app not deleting problem? Close apps you are not using and try to delete again.



    The same issue happens when ejecting a drive and the worst case is a damaged filesystem by pulling out the plug. For deleting, it's lost time. Why should users have to try and randomly close apps to see what is going on when Apple developers could spend about 10 minutes writing a feature that checks what's using it and tell you?



    Quote:
    Originally Posted by Hiro View Post


    Now contrast that to the hue and cry of Sherlock/Spotlight vs. Watson or Dashboard vs Konfabulator.



    Indexed search was nothing new, Dashboard was something that did tread on a 3rd party developer but what we're talking about here is a very basic fix in the OS, not a fully fledged Apple application to rival a 3rd party. It's like Copy/Paste on the iphone. You may say but if Apple implements it then it stops 3rd parties trying to find a way. It's functionality that Apple should have put there in the first place because it affects usability.



    Quote:
    Originally Posted by Hiro View Post


    Those that eventually become knowledgeable of the command line power but don't wish to learn the invocations can easily find the apps.



    Even knowing the command line commands doesn't make it more efficient.



    the way it should be:



    dialog: the document 'text.txt' could not be deleted as it is in use by TextEdit - choices: close and remove the file, cancel



    the way it is now:



    dialog: the document... is in use



    solution: open terminal, use lsof command on file, bring forward the app using it, close the file, go back to trash and try again. If it's still in use, go back to the app and quit it and trash.



    It's a ridiculous workaround for something so basic and it's not as if they haven't done it elsewhere. The permissions in the get info box. They didn't have to put them there when the command is simple enough to use a terminal and they work better from the terminal but they did it because it's quicker to change permissions in the Finder when you are already there.
  • Reply 7 of 9
    pbpb Posts: 4,234member
    Marvin described the situation in a very clear and precise way and I agree 101% with him. Why one should go out hunting applications that could be using a file when the solution is so simple?
  • Reply 8 of 9
    irelandireland Posts: 17,746member
    .AVI's cause problems for me sometimes, cannot Empty Trash because item is in use \
  • Reply 9 of 9
    pbpb Posts: 4,234member
    Quote:
    Originally Posted by Ireland View Post


    .AVI's cause problems for me sometimes, cannot Empty Trash because item is in use \



    Had you the chance to try the Terminal way previously described? If yes, what it gave?
Sign In or Register to comment.