File won't delete!!!!

Discussion in 'macOS' started by Killyp, Jun 29, 2006.

  1. Killyp macrumors 68040

    Killyp

    Joined:
    Jun 14, 2006
    #1
    Hi there

    I recently tried to install the syncing software for a PalmOS device (PalmDesktop?) and I didn't like it. Upon dragging the folder to the trash, and emptying it, it gave me an error:

    The operation cannot be completed because the item "Localized.rsrc" is in use.

    the two buttons are STOP and CONTINUE

    I have tried a file shredder, and repairing disk permissions, and NONE of them work. What should I do?!?!? The rubbish Palm software is driving me nuts!
     
  2. Phil A. Contributor

    Phil A.

    Joined:
    Apr 2, 2006
    Location:
    Telford, UK
    #2
    It may be obvious, but have you tried re-booting and then trying to empty trash?
     
  3. gloss macrumors 601

    gloss

    Joined:
    May 9, 2006
    Location:
    around/about
    #3
    That is the ol' fashioned System 7 way of doing things.
     
  4. ChrisBrightwell macrumors 68020

    ChrisBrightwell

    Joined:
    Apr 5, 2004
    Location:
    Huntsville, AL
    #4
    In terminal:

    rm -f /path/to/Localized.rsrc

    Replace "/path/to/" with the actual directory of the file.
     
  5. Killyp thread starter macrumors 68040

    Killyp

    Joined:
    Jun 14, 2006
    #5
    I've tried the above and it doesn't seem to do anything...

    It just goes to a new line. This stupid file is really irritating me now! Is there any way I can find out what the process is that's using it and Force Quit it just while I try and delete the file?
     
  6. imacintel macrumors 68000

    Joined:
    Mar 12, 2006
    #6
    dpplanka would know.
     
  7. Eraserhead macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #7
    Then it should be done. If not you haven't got the path correct
     
  8. ChrisBrightwell macrumors 68020

    ChrisBrightwell

    Joined:
    Apr 5, 2004
    Location:
    Huntsville, AL
    #8
    UNIX is good about being quiet until something goes wrong. If there's no error or anything, the file should be gone.
     
  9. MacMarvin macrumors member

    Joined:
    Jun 29, 2006
    #9
    If you type

    lsof | grep <filename>

    into the terminal, it will tell you what's using the file. Note, not the pathname, just the filename and it's case sensitive.

    Normally, secure delete works for me when the Finder reports a file in use.

    Incidentally, if you get a device in use, you can type df to get a list of drive names (e.g. /dev/disk0s3) and then do lsof /dev/disk0s3 and it will tell you why you can't eject the device.

    Of course, if that fails, you can type hdiutil eject -force /dev/disk0s3.
     
  10. Killyp thread starter macrumors 68040

    Killyp

    Joined:
    Jun 14, 2006
    #10
    I've put the files in the following directory:

    the hard disk is "HD1"

    the folder is "palmdesktop" (straight inside the root of the hard disk)
    and the file is "Localized.rsrc"

    what would be the exact thing that I type into Terminal??

    I'm used to DOS syntax... :eek:
     
  11. Eraserhead macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #11
    'rm /palmdesktop/Localized.rsrc' without the single quotes
     
  12. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #12
    Did you do this? I suspect not.
     
  13. Killyp thread starter macrumors 68040

    Killyp

    Joined:
    Jun 14, 2006
    #13
    okay, so I removed the Localized.rsrc file (yay! thanks!) but there's still a copy of it inside the original file.

    The file is located in rm /palmdesktop/ and is called PalmDesktop


    I cannot remove this file, it gives me the same error message...
    When I enter the syntax posted above into Terminal with the ending changed for that 'file', it says This is a Directory. How do I change that so it removes a directory instead?

    many, MANY thanks guys!!!
     
  14. MacMarvin macrumors member

    Joined:
    Jun 29, 2006
    #14
    If you want to do the lsof thing, you'd type the following:

    lsof | grep Localized.rsrc

    The | symbol is that key next to the return key in case you don't know.

    One thing is that if you are not sure about pathnames, just drag the file into the terminal window. So if you wanted to do what was mentioned above, you would type rm into the terminal and the just drag the file into the window and hit return.
     
  15. taylorpc macrumors member

    Joined:
    Dec 29, 2005
    Location:
    St. Louis, MO
    #15
    Did you try doing a "Secure Empty"? The same thing happened to me when I tried to delete WMP from my computer. Someone advised me to do a secure empty, and it worked.
     
  16. plinden macrumors 68040

    plinden

    Joined:
    Apr 8, 2004
    #16
    There's probably an instance of Transport Monitor running. Kill this from Activity Monitor. Then you should be able to remove PalmDesktop from Applications.
     
  17. neocell macrumors 65816

    neocell

    Joined:
    May 23, 2005
    Location:
    Great White North
    #17
    I get the same error the OP indicated every time I try to empty the trash if a file is in there that I was just using in Preview, even though I closed the file. In order to delete I have to either quit Preview or Relaunch Finder and it will then allow me. Stupid Preview, or maybe stupid Finder
     
  18. Killyp thread starter macrumors 68040

    Killyp

    Joined:
    Jun 14, 2006
    #18
    Okay, this is really wierd! I've done the LSOF thing, and it removed all the localized.rsrc files on the hard disk.

    The problem in the first place was that the RSRC file was inside an application package, and this was what I couldn't remove. I can't open the package to uninstall it or anything...

    When I enter the package's directory into terminal with the LSOF command, it says it's removed all the files, but when I drag the Package into the trash, and empty it, it still says "Localized.rsrc is in use" even though I can't find a localized.rsrc anywhere in the folder!!

    There is actually more than one package, but I moved them all into one folder in the "HD1" root (HD1 is my startup disk) to see if I could remove the folder. It allows me to move the files around, but not delete them...

    So how do I remove a directory in terminal?
     
  19. WildCowboy Administrator/Editor

    WildCowboy

    Staff Member

    Joined:
    Jan 20, 2005
    #19
    You remove directories by using "rmdir" in place of "rm"...but I still feel like this should be able to be resolved with a restart. If you check your login items to make sure no component of that software is loading on startup, you should be able to restart and then delete whatever you want at will.
     
  20. MacMarvin macrumors member

    Joined:
    Jun 29, 2006
    #20
    LSOF doesn't remove files, it just tells you what's using them. What the command I wrote actually does is list the current user's open files and narrows the list down using grep to isolate the file in question.

    RM is the command that removes the files.

    If it was inside a package, it's most likely that application that's causing the issue. It may still be running. If you open the activity monitor (in /Applications/Utilities/) you can see if palmdesktop or a related program like the one someone else mentioned is still running. If so, quit the program.

    The Activity monitor is really useful because if you select a process and inspect it with the blue i button or command-i, there is a tab listing the open files for the process.

    I would use rm -rf and then drag the folder into the terminal.
     
  21. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #21
    Hold down Option while selecting Empty Trash. I rarely have luck with this method, but it's worth a shot.
     
  22. Killyp thread starter macrumors 68040

    Killyp

    Joined:
    Jun 14, 2006
    #22
    Ahh, the LSOF command has revealed that it's Finder that's using the file...

    Even after a reboot (or two), Finder still won't let me remove them!

    Is there any way I can empty the trash while finder isn't running?
     
  23. plinden macrumors 68040

    plinden

    Joined:
    Apr 8, 2004
    #23
    Have you closed down Transport Monitor? This is a Palm process that checks for the Palm handheld being connected, and sync started. If you did the standard install, it'll be running as a StartupItem.
     
  24. Killyp thread starter macrumors 68040

    Killyp

    Joined:
    Jun 14, 2006
    #24
    Yay! Done it!

    I quit terminal in Activity Monitor, and then entered this command into Terminal:

    rm -rf ~/.Trash/*

    I then restarted Finder, and all was well!

    One small problem, when you move a file to the trash, it seems to keep it connected to the hard disk partition it was originally on. When I first had this problem, I went a bit crazy, trying to move files between partition, but I ended up duplicating them...

    So, the rm -rf ~/.Trash/* command only seems to remove the files in the trash from one partition, (named HD1, my Startup disk). How do I remove the files from the secondary partition (HD2)?
     
  25. MacMarvin macrumors member

    Joined:
    Jun 29, 2006
    #25
    Every partition has its own trash folder. This is necessary because it means you can delete stuff without the system copying files to one main trash directory. On external drives, this folder is in the root folder called .Trashes (note not .Trash).

    You may need admin permissions to see it. If you type this into terminal, it will list the trash contents on a drive:

    sudo ls -al /Volumes/<drive name>/.Trashes

    It will ask for you password.

    Normally, the trashes folder has a list of folders named by user ID. I think 502 is the default admin ID so inside .Trashes there should be a folder called 502. To see what's in there, you would just do this:

    sudo ls -al /Volumes/<drive name>/.Trashes/502

    to empty it, you would type

    sudo rm -rf /Volumes/<drive name>/.Trashes/502/*

    Again to save typing the name, you can drag the volume to the terminal but don't drag it from the Finder sidebar. This will just remove the drive from the sidebar. If you don't mount volumes on the desktop, add the computer to your Finder sidebar (or go menu>computer) and access it there.

    You can also use tab as an autofill so if you type /V (for /Volumes... above) and then tab, it will fill in the rest of the name.

    In general, it's not a good idea to use sudo rm. Save it for those times when it's absolutely necessary. You can actually erase important stuff that way. This is why it's good to drag stuff to the terminal too because if you accidentally left a space out between the first / and what came after it, you'd erase your entire partition.
     

Share This Page