Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

majordude

macrumors 68020
Original poster
Apr 28, 2007
2,441
75
Hootersville
How do I delete files in use?

I have a bunch of files... I must have had a HD burp or something. I have a bunch of files under "lost+found". I try deleting it but I can't!

The folder has a bunch of other folders ("dir...") but I can't delete them! They are NOT in use as far as I can tell.

HELP!
 

Attachments

  • Picture 6.png
    Picture 6.png
    56 KB · Views: 1,130
Under the Finder menu, use 'Secure Empty Trash'. But I think the option click does this anyway.

It takes a while longer if there is a lot of stuff though.
 
Check the files/folder owner with Get Info then change their access privileges with your administrator account.
I Belive if you drag them to the Trash while holding the option or cmd key will overrride any obstacle ( haven't use this in a while).
If nothing of this works you may need to use the Unix terminal and use a command to delete them.
________
magic flight launch box
 
Last edited:
Try holding "option" while pressing the delete button.

Nope.

Under the Finder menu, use 'Secure Empty Trash'. But I think the option click does this anyway. It takes a while longer if there is a lot of stuff though.

Nope.

Check the files/folder owner with Get Info then change their access privileges with your administrator account. I Belive if you drag them to the Trash while holding the option or cmd key will overrride any obstacle ( haven't use this in a while). If nothing of this works you may need to use the Unix terminal and use a command to delete them.

Nope.

Everything is still locked. :(
 
I have this happen to me on the odd occasion, a reboot usually sorts it all out.
 
If the files are still in use, I normally let the trash delete every thing that it can using option delete and then restart. Thats the only thing Ive found that works. This usually happens when I delete a program and its still running. You can also try to quit the process in activity monitor.
 
I've rebooted but it doesn't help. It thinks the files are in use (and they obviously aren't). I still can't delete the folder. :mad:
 
Ok, try this. Open Terminal, type "rm -rf " and then drag the Trash folder onto that window (or if you want, the folder that's giving you trouble), and then hit enter. If it gives you an error, add "sudo " to the beginning of the previous command and do it again. That shouldn't pay attention to whether those files are open in any OS X application, and especially not if they're not actually in use.

jW
 
Ok, try this. Open Terminal, type "rm -rf " and then drag the Trash folder onto that window (or if you want, the folder that's giving you trouble), and then hit enter. If it gives you an error, add "sudo " to the beginning of the previous command and do it again. That shouldn't pay attention to whether those files are open in any OS X application, and especially not if they're not actually in use.

Nope.

---

Last login: Fri Jan 25 18:17:57 on console
172:~ Home$ rm -rf
172:~ Home$ /Volumes/External\ HD/.Trashes/501/1
-bash: /Volumes/External HD/.Trashes/501/1: is a directory
172:~ Home$ sudo rm -rf

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
172:~ Home$ /Volumes/External\ HD/.Trashes/501/1
-bash: /Volumes/External HD/.Trashes/501/1: is a directory
172:~ Home$

:mad::mad::mad:
 
Just grasping at straws at this point, but is there any chance these originated on an external HD or memory stick? If you've used either one recently, plug it back in and try the normal Empty Trash.

Try Repair Permissions and then try to Empty Trash again.

Run Activity Monitor and look carefully to make sure there's nothing unexpected running in the background. If you see anything suspicious, stop the process and then try to Empty Trash.

Weird.
 
Run Activity Monitor and look carefully to make sure there's nothing unexpected running in the background.

Not that it makes much difference after the problem is solved, but here's a simple shell trick. In terminal type:

lsof | grep "filename you can't delete"

This will tell you exactly which process is still using the file. Simply killing this process solves the problem most of the time. However, in case of lost+found I doubt it.
 
Syncronicity.

I'm running http://www.faqintosh.com/risorse/en/sys/setrash/ at this very moment. Sorta scary. The HD is GOING NUTS!

I'll be back in a bit... (I hope)
"Going nuts"? What do you mean? Don't scare me, mate :eek:

I'm sure that Super Empty Trash won't cause any damage to your HD, and that's because I wrote it: it's a simple Applescript that actually query the Finder for trash content, then deletes such content recursively through a "sudo rm -Rf" command.
 
"Going nuts"? What do you mean? Don't scare me, mate :eek:

Thanks for writing the program!
:)

My "going nuts" comment was my reaction to the noise coming from the disk as the script deleted 50GB of stuck files. If you have ever deleted that much information, you know the noise I'm talking about... if not, let's just say you know that there is a whole lot of data disappearing of one of your hard drives. ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.