![]() |
Undeletable files?!
I have a file that I just cannot delete.
The filename contains some Unicode characters that seems to make it impossible to unlink it. When I empty the trash, Finder logs this to the console: Finder tool: request to change uid to 501 gid to -1 for /Users/me/.Trash/bbb/MatÌûö̺?.dclst I tried to change the filename through the Finder, but that just gives me another error message: Operation could not be completed, error code -43. So I tried using the shell: I can see the offending file using /bin/ls (/sw/bin/ls won't work): $ ls /Users/me/.Trash/bbb/ Mat??????.dclst But the -l switch doesn't work: $ ls -l /Users/me/.Trash/bbb/ ls: Removing the file doesn't work: $ sudo rm -rf bbb/* gives no error message, but the file is still there: $ ls bbb Mat??????.dclst Removing the enclosing folder doesn't work: $ sudo rm -rf /Users/me/.Trash/bbb rm: bbb: Directory not empty Of course I can't rename the file or change permissions, because the shell won't handle the filename correctly.. Any ideas anyone? Thanks, -sapporo. |
http://forums.macosxhints.com/showth...hlight=unicode
Try the hint in the second to last post, maybe? |
Doesn't help, unfortunately.
$ ls bbb Mat??????.dclst $ ls -i bbb ls: Thanks anyway, -sapporo. |
Try Super Get Info - it has a menu item for deleting the trash that, in my experience, is pretty good at getting rid of stubborn files.
|
Nope.
2003-04-04 21:14:42.236 Super Get Info Helper[1513] CFLog (20): Error: An error occurred while trying to empty the trash with Super Get Info. Mac OS Error Code: -9875. |
I have turned tab completion back on for tcsh. If you have also turned on tab completion what you might try is
rm -f Users/me/.Trash/bbb/Ma<press tab> for me that would complete the file so the shell can use it. you also might just try removing the file through sudo incase there is a permission problem. |
This is usually the point where it's suggested to jump into OS 9 and delete it, but I refuse to believe that there is no way to delete it in OS X.
If you don't mind messing around, try cd'ing to the folder. Then, type sudo rm -f Mat[tab] if it doesn't complete (I'm guessing you've probably already tried this), what about if you're using a different shell (bash or ksh or ?) Or possibly sudo rm -f *.dcslt Also, what about using Trash It! http://www.nonamescriptware.com/ Or possibly su root? As a last resort before OS 9, what about booting into single user mode? |
Quote:
Quote:
Quote:
Quote:
Quote:
Thanks guys! Later, -sapporo. |
Here's one from the Unix faq that you might try:
first get the inode number of the file: ls -i * 32700 Mat??????.dclst then: find . -inum 32700 -ok mv '{}' new-name \; should let you rename the problem file. (you can also just remove it with: find . -inum 32700 -ok rm '{}' \; ) Breen |
That's what xchanyazy referred to in his post, but it won't work (see above).
Thanks anyway, -sapporo. |
Damn, damn, damn.
I checked that thread -- must have gotten a partial page because it didn't show up the first time. I just reloaded it and found the first post. Sorry. Breen |
unlink in Perl
You should be able to find out the name of the file in terms of octal values for the non-ASCII characters by using 'vis -o' or 'od -c'.
Use 'ls' to pipe the name to one of the above. E.g.: ls bbb | vis -o Once you have the full name of the file, you should be able to delete it by using the 'unlink' command in a Perl script. Here's the example from the O'Reilly UNIX Power Tools book (where I got this idea): perl -e 'unlink("\t\360\207\005\254");' But you might even be able to delete it by putting the full name (using octal escapes) inside double quotes: rm "\t\360\207\005\254" |
This might really be stupid, but it would not be the first time that I said something stupid so here goes.
This is assuming that problem file is in the folder bbb. 0. Can you change its name in the Get Info window? 1. Set DropStuff to delete the original after stuffing and then drop the folder bbb onto DropStuff? 2. Does gzip have an option that lets you use gzip on a folder? ...gzip automatically deletes the original. |
macmath, i consider those very clever approaches. thanks for steering at a problem from different vectors.
|
The file may have an immutable flag or system immutable flag set. Learn how to unset it here:
http://www.osxfaq.com/Tutorials/Lear...Trash/index.ws |
That wouldn't explain why I can't ls it properly. I'm convinced it's the filename that's causing the problem.
I'll try to delete the file by mounting my drive in FireWire target disk mode. |
what didn't work?
Sapporo, could you please tell su which of the suggested deletion methods you have tried and why they didn't work?
This is important for future reference - for others who may have similar problems later. |
I tried renaming the file through Finder (by selecting the filename and the Get Info window). Finder logs an error message to the console (see above).
I tried SuperGetInfo, but it fails just like Finder (see above). I tried all the shell-based methods mentioned so far, but none of them worked. I missed hayne's post about vis and od at first, and found out I could achieve the same result (the filename with non-printable characters in octal representation) with ls -b (I'm using gnu ls which is part of the gnu fileutils package available through fink): $ ls -b Mat\355\236\232\355\274\262.dclst Still, I can't get any shell command to work on this file: $ rm "Mat\355\236\232\355\274\262.dclst" rm: Mat\355\236\232\355\274\262.dclst: No such file or directory But hey, I feel I'm getting closer. Thanks all, -sapporo. |
Quote:
While I could not ls it or directly work with it via the command line, I could rm bbb/* and change its name at will. I even gave it an immutable flag 'sudo chflags -R uchg bbb' and I was still able to trash it, although I could no longer change its name. However, while it had an immutable flag, it had a little lock in the lower left of its icon (something I'm sure you would not have missed). I then cleared this flag, gave it root:admin privileges with no read or write by anyone and then gave it an immutable flag as well. Now I could not trash it or change its name, but I could clear the flag, give myself privileges for it, and trash it. Anyway, while this experiment is not perfect since I might not be able to duplicate the name exactly, or might not be allowed to change the name to something which I can't also change it away from, I think the problem goes beyond the name itself. Perhaps a disk repair with Disk Utility or DiskWarrior is in order to discover something wonky about the catalog. |
i remember
I have experienced this, with files with latin-1 characters in them (not all i have, whew!, just 3-4), swedish characters like åäö
I think either the files were removed, but spooked in the disk TOP, or they are named such that nothing between the kernel and aqua can handle them. The only way I've been able to get rid of the files have been: 1 remove hosting folder in OS9 2 reformat and install 3 hide it somplace it won't bother (move hosting folder) |
I finally got sick of all this and mounted my PowerBook on my girlfriend's PowerBook in FireWire target disk mode. Contrary to what I expected, I could delete the file from Finder without a problem. And yes, that makes it look like a permission problem..
I guess now I'll never find out what the real problem was :-( Thanks again all, -sapporo. |
It is too late now, of course, but if this crops up again, perhaps this suggestion might be useful. Apple came out in late February with an application called the "File Name Encoding Repair Utility". You can find the Apple KnowledgeBase document about it (and a download link) by going to Sherlock 'AppleCare' and doing a search on 'encoding repair'.
Excerpt: Quote:
|
I am having the exact same problem with a file with the name "Ti?ng Viê?t.html"
The system and none of the applications on the system can see this file, including Apple's utility! Therefore, it is impossible to delete. Is there a way to delete this file without having to install OS 9? Ron |
This issue is four years old??? Is anyone still reading this thread?
I wouldn't mind if a kind person could read this and get back to me, because I cannot subscribe to this thread for some reason. (probably because I am new). Ron |
I'm still subscribed, but haven't come up with a solution yet :-)
|
Quote:
|
Quote:
I'll check and see if I can find anything... Thanks! |
I don't suppose you could point me to the issue... i've looked high and low on Adobe's web site. There are many issues related to deleting files on their site...none of them seem to address this issue...
I would really appreciate any pointers... Quote:
|
Success!!
Just so people don't have to go searching through dozens of threads, I found the solution to this particular issue.
Apparently, certain file names cause the directory structure to be confused, and there are files that don't exist showing up on your hard drive. This is apparently an illegal file name that causes problems. If you run the Disk First Aid, by booting off of your CD-ROM and selecting Disk Repair, it will fix your directory structure. The method for rebooting into single user mode, and issuing an "fsck" command will do the same thing. Ron |
| All times are GMT -5. The time now is 06:06 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.