Unable To Empty Trash (Files In Use)

Discussion in 'Mac Basics and Help' started by i.shaun, Jul 8, 2008.

  1. macrumors 6502a

    i.shaun

    Joined:
    May 1, 2008
    Location:
    Canada
    #1
    This may sound simple, and I did search the forums. One thread suggested holding down "Option", that did nothing. "Command" "control" or any combination of the Three also did nothing.

    Another Thread gave a program called "Force Empty Trash". It is only tested on 10.3 or something, I run Tiger 10.4. I Ran the program anyway, and the Trash emptied, but then the Phantom Files Returned.


    The files in question are Corrupted iTunes music folders that had nothing in them, but I couldn't access them. "File Cannot Be Read Or Written"

    I Tried Deleting them, and most moved to Trash -- one was stubborn. A Repair of Disk Permissions Made it enter the Trash Bin -- and that is where they Remain.


    I rebooted, and attempted an Empty, but It tells me "File Is In Use" despite the fact that; A: iTunes is closed, and B: It was part of a different iTunes Library (I moved, and re-added everything after dealing with the corrupt folders)


    So now I am at a Loss as to how to get rid of these files. They are not locked, and are set for me to "Read & write" in the Permissions. Is there a program that would Tell me what Processes are linked to the folders? What could still be accessing them?


    I was told maybe I have a Virus, if so, what are the best up-to-date OS X Virus scanners?
     
  2. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #2
    Did you see the suggestions in this thread? Or this page, from a simple Google search?

    One thing is for sure: it's not a virus! There are no viruses that affect Macs.
     
  3. thread starter macrumors 6502a

    i.shaun

    Joined:
    May 1, 2008
    Location:
    Canada
    #3
    I did not see that thread, I tried the steps. No luck.


    I cannot Delete from Trash because I get "File In Use"

    I cannot move them onto the desktop, I get "Some Of The Data Could Not Be Read Or Written Error -36"

    I attempted the Terminal command from the Trash Bin instead of the desktop and get:

    rm: illegal option -- -
    usage: rm [-f | -i] [-dPRrvW] file ...
    unlink file
     
  4. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #4
    Did you try the second link?
     
  5. thread starter macrumors 6502a

    i.shaun

    Joined:
    May 1, 2008
    Location:
    Canada
    #5
    sorry, the second link had a lot of info to look through.

    I'm a bit nervous using Terminal while sitting on an Administrator account. Even though I'm not computer Illiterate -- I am Command-Line/programming Illiterate.

    For some reason, when I tried to find out which process or program was accessing the files -- It was displaying finder. Finder always reboots faster than I can empty the trash (when I force quit/relaunch)

    I also was getting errors stating "This is a directory." and stopping there.

    or "data could not be read or written"

    However, using the Terminal Command:

    sudo rm -rf ~/.Trash/*

    seems to have worked. I can just hope they do not return once again.

    Thank you.


    I never thought that it would have been such a hassle.
     
  6. thread starter macrumors 6502a

    i.shaun

    Joined:
    May 1, 2008
    Location:
    Canada
    #6
    it was actually the

    sudo rm -rf ~/.Trash

    Command that did it. It Trashed my Trash Can. It says once I log Out, and back in, I will have another Trash, with proper permissions.
     
  7. macrumors regular

    cptpower

    Joined:
    Sep 10, 2007
    Location:
    Calgary, AB
    #7
    I didn't read the other threads, but an option for this would've been to open up the terminal and type:

    Code:
    lsof | grep <insert_file_name>
    
    This command will output what program is using the file that you're trying to delete. Then you can quit that particular program and you should be able to empty the trash without having to resort to anything severe like trashing your trash can.
     
  8. macrumors 65816

    merl1n

    Joined:
    Mar 30, 2008
    Location:
    New Jersey, USA
    #8
    You could have booted in Safe Boot mode. That would have disabled the iTunes Helper in your login items. You then would have been able to empty the Trash.
     
  9. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #9
    Yes, that was in the other thread.
     
  10. macrumors newbie

    Joined:
    May 12, 2010
    #10
    Thank you so much OP, this command solved my problem also.

    sudo rm -rf ~/.Trash/*

    If anyone is having a similar problem and hasn't tried this, do so immediately.
     
  11. macrumors newbie

    Joined:
    May 9, 2011
    #11
    Nothings Working Please Help!

    None of this is working for me. I have some system files from a friends windows computer that my external auto backed up. The files are supposedly in use by finder. The files disappear after using the sudo terminal command and the trash icon/folder is empty but when i attempt to empty the trash they show back up. I cant copy them out of the trash. No form of command, option, shift, and delete works. I have no clue what to do and I about have my last hair pulled out. Any Ideas?
     
  12. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #12
    When you empty the trash, is the external drive still attached?
     
  13. macrumors newbie

    Joined:
    May 29, 2011
    #13
    You might wanna try changing the file's extension in the trash, I always change it to .rar and then I can delete it, never showed up again. Just had only 2 of these files.
     
  14. macrumors newbie

    Joined:
    Dec 2, 2012
    #14
    Worked for me
     
  15. macrumors regular

    stuart2102

    Joined:
    May 29, 2011
    #15
    I have problem on this too yesterday until now i cannot empty(trash) of my deleted files i already try one given suggestion here but it didnt work maybe is it wrong the way i do it? can any one give me step by step how to totally deleted my files that is in Trash? the is the message i receive when i try to empty my trash "The Finder can’t complete the operation because some data in “Man vs. Wild S1” can’t be read or written.
    (Error code -36)
    " and i was wondering why this happen?
     
  16. macrumors 65816

    merl1n

    Joined:
    Mar 30, 2008
    Location:
    New Jersey, USA
    #16
    The file in the trash looks to be corrupted and the Finder can't handle corrupted files.

    You will need to launch the "Terminal Program" and type the following commands (listed in blue):

    1. Type sudo ls -al .Trash

    2. If you see a folder listed called 501 then type sudo rm -rf .Trash/501/*

    3. If there is no 501 folder listed then just type sudo rm -rf .Trash/*

    That should empty the trash. Now quit the Terminal app.

    HTH.

    Merl1n
     
  17. macrumors regular

    stuart2102

    Joined:
    May 29, 2011
    #17

    Still the same it didnt work, actually all that was given here as options i already tried it but seems doenst work on my imac
     
  18. macrumors 603

    justperry

    #18
    In your original post you did not say wether or not the files in the trash were originally on the internal HD or an external source, I ask this because if it's an external and is for instance NTFS you should repair that disk before.

    If it is the internal you should repair the disk with Disk Utilities but if those files belonged to the boot up Volume and you want to repair that one you have to boot from a different Volume or External volume.

    If it is a newer machine you can also startup from internet Recovery and use Disk Utilities there.
     
  19. macrumors regular

    stuart2102

    Joined:
    May 29, 2011
    #19
    Oh yeah sorry if i didnt mention if the files are coming from, uhmm...its coming from my external drive, i tried to repair but it says a message that it cannot repair anymore, uhmm i dont really get this "boot up Volume and you want to repair that one you have to boot from a different Volume or External volume" meaning?
     
  20. macrumors 603

    justperry

    #20
    Is it formatted as NTFS!!!!!!!
    I asked this before, if it is the Mac can NOT repair the disk, you need to do this on Windows or if you have windows installed in bootcamp try from there.
     
  21. macrumors regular

    stuart2102

    Joined:
    May 29, 2011
    #21
    Oh im sorry i missed the line when u ask about it if it is ntfs of mac journal format, uhmm yes its ntfs, now i got it i wonder why i cant repair the disk thanks for it, uhmm can i raise question? uhmmm what happen why external HD i want to repair stop on working when i tried to make backup to my internal drive? it ejected by its own and i received message that says my hd was not properly ejected uhmmm im transfering files around 200gb
     
  22. macrumors 603

    justperry

    #22
    The main reason your disk got damaged is because it was " hd was not properly ejected", this is probably not your fault but might be because you have a bad NTFS driver installed, if that is the case install a better NTFS driver like Paragon or, if you don't need the disk to be used on Windows erase the disk as HFS+.
     
  23. macrumors regular

    stuart2102

    Joined:
    May 29, 2011
    #23
    Thank you so much...uhmm my trash now is empty i dont know what happen when i empty my trash again all the files from my external HD was sent there in the trash was gone whoaaah that was strange hehehe anyway thanks a lot guys...but still it puzzle me hehehe
     
  24. macrumors regular

    stuart2102

    Joined:
    May 29, 2011
    #24
    aaahh still the same!!! huhuhu my files are still in my external HD and still i cant delete forever in my trash what happen to this, trash in mac gives me headache, i will try to delete my files in windows let see if still the same
     
  25. macrumors regular

    stuart2102

    Joined:
    May 29, 2011
    #25

    Yes i tried the terminal command for emptying my trash but stil doesnt work, i thought all are empty this morning, but when i put my exHD the files that i want to delete forever are still there, actuaally this files was not properly copyed in my exHD due to interuption like it eject my exHD with out any reason that is why, i dont know why or maybe my keyboard is not enough power to supply that is why it ejects in the middle of transfering batch files, now i tried to put my exHD at the back (usb) port of my imac and the transfering of data is smothly goin nice, my only concern now is how to delete forever those files that was intrupted.
     

Share This Page