Cannot delete file

Dyldjian

Registered
Hi, I have an .app file on a USB Drive that I can't seem to delete, I have looked at the Get Info window and everything to do with permissions is greyed out, although it does say I have read/write permissions in grey.

Anyway taking some advice from another forum I went into terminal and tried this code:
Code:
cd ~/.Trash/
sudo rm -rf [filename]

but it just said after each file in the package that it was read only and didn't delete it. So how can I change the permissions?

I would like to add that I dont want to reformat the drive because I'm pretty sure there are some hidden files on there and the drive is actually a mobile broadband modem, but does have a little storage capacity on it. I dont want to run the risk of deleting files that might make the modem work.
 
What is the file name? Could it by any chance be an essential file assoc w the mobile broadband which has accidentally been moved to the trash?
 
If you are sure it is not an app that is needed for your broadband, you first have to change the permissions.
If it is in the trash already, move it out of the trash and back to the USB drive.
Click once on that file, and do Get Info.
At the very bottom of that window, is there a pad lock? Click on it, enter your password when prompted and now check to make sure you can read & write.

Now depending on what OS version you have will depend if you have just a check box with apply to enclosed items next to it or if you have a gear with a pull down menu at the very bottom of the get info window. In either case, you want to select that. It may take a while, but when it is done, you should be able to trash it and empty the trash.

I stress that you must make sure it is an app that is absolutely not needed.
 
Code:
cd ~/.Trash/
This command with always take you to the hidden "Trash" folder inside your home directory... the tilde (~) means "home directory", so any command you issue after that will be executed on the files in the "Trash" directory in your home folder.

The hidden "Trash" folder in your home directory does not contain any files from the flash drive. Each separate volume has its own hidden "Trash" directory, so you would need to change directory to the flash drive's "Trash" directory.

Essentially, because of that command, you're doing nothing on the USB flash drive. You would need to replace that command with something like:
Code:
cd /Volumes/flashdrivename/.Trash
...if you wanted to operate on files in the hidden "Trash" directory on the flash drive ("flashdrivename" should be replaced with the name of the flash drive, of course).

Also, I believe the name of the folder you want to change directory to is called ".Trashes", not ".Trash".
 
Hi, thanks for your replies.
I've backed up the file in case this buggers everything up but I'm 99% sure it won't.

I tried the Get info thing, clicked on the lock to unlock it, but the only thing it seems to unlock is the owner, not the access fields. I tried changing the owner to 'everyone' or 'system' in case that made a difference but it didn't even allow me to do that. it came up with an error message: "an unexpected error occurred (error code 195)".

So I'm beginning to think it cant be deleted.

oh and I have OSX 10.4.11 if that helps.

Thanks for the update on the code but I think I need to get the permissions sorted out before I can try deleting again

Thanks again
 
Back
Top