File Name With Unrecognized Characters

dukefang99

Registered
Ok, so I have a file on my computer (I'm running OS X 10.3.9) that has some strange unrecognized characters in it, and as a result I can't seem to do anything to this file. I want it gone.

It claims it takes up 0 kb of space. When I try to open it the program opens but not the file. I CAN move the file from folder to folder, however any attempt to rename the file or delete it or its containing folder results in an ERROR -43. I have tried renaming it through clicking, "get info" and through terminal. I have also tried deleting it through terminal. However, the problem seems to be that, because of the unrecognized characters, although terminal recognizes the file is there when i perform the ls command, that I cannot delete it because in place of the unrecognized characters appear question marks. Thus, when i try and enter, or copy, the file name to delete it or rename it, terminal then says the file does not exist.

I don't know if this information will help, but the strange characters in the file name look like square boxes that are half shaded gray and the other half is white with a small slash through it.

Can someone out there help me? It would be greatly appreciated!
 
The file was originally located in a drop box folder for a file sharing program I was using about a year ago (yes thats how long this file has been sitting there). I can move it anywhere though, and it's currently sitting on my desktop. I assume this problem was probably caused by this file originally being from a PC, but I don't know for sure.
 
Try this:

1) Open Terminal
2) Type "sudo rm " (no quotes, note the trailing space, do not press enter yet)
3) Drag and drop the file onto the Terminal window where you just typed that. Full path should fill in automatically.
4) Press Enter, then authenticate with your admin password.
 
Why not? What happens when you try to do that? Error messages? Won't drag at all? Drags but snaps back without filling in the path?
 
Strange... you said you can drag the file anywhere, though?

Try this:

Create a new folder on your desktop, then drag the file into it, then trash the folder.

Other than that, I just don't know! Strange that it won't let you change the filename!

Hmm... can you try creating an archive of the file, either .zip or .sit, then trashing that file?
 
Ah, ok well that didn't work but I did learn something new. The file won't leave its containing folder, which also refuses to be deleted. When I try to rename the file, I also get an error -43. The containing folder can, however, be moved wherever.

Any other ideas?
 
I often get strange permission settings when I use drop boxes. Get Info on the file (select the file and go to the File menu) and set the "owner" to your account and be sure the access level is "read & write". You might also need to do this for the containing folder.
 
dukefang99 said:
Ah, ok well that didn't work but I did learn something new. The file won't leave its containing folder, which also refuses to be deleted. When I try to rename the file, I also get an error -43. The containing folder can, however, be moved wherever.

Any other ideas?

This comes from the notion that MAC OSX is Unix: Open Terminal.app, type
sudo su - and give your password. You should be as root (the Unix superuser).
Then type

# cd ~yourname/Desktop

(The # is your prompt, do not type it) you said it is on your desktop, right?

Then type

# ls -i

You should see list on number, filename pairs. Check the number of the file.
It is its inum (in Unix files are actually associated with inum; name is only an
alias to the inum) .

Then type

# find . -inum 44444 -exec rm '{}' \;

where 44444 is the number. The find command is switch army knife of
Unix; in this case it search file with inum same as ls -i, then it executes
the rm command and gives the name (in place of {}).
 
wow ok, i think this is going to work, but I'm a little confused with the last line of command

the inum is 2955126

can you write out exactly what I would do in that last line of command again to get rid of this file? If you could even write it out in a way that I could simply copy and paste it into terminal I would be eternally greatful :D

You're a lifesaver btw!!!!
 
something is still wrong, I'll show you exactly what I'm writing and maybe you can tell me what I'm doing wrong:

root# find . -inum 2955126 -exec rm '{}' \;

is what I entered into the terminal, and when I do so all I get is this:

find:

and then it IMMEDIATELY skips to the next line of command. I have also tried the above command without the ending semicolon with the same result as well as replacing the two brackets with a name for the file...What am I doing wrong?

Thanks again for all the help provided thus far!
 
dukefang99 said:
something is still wrong, I'll show you exactly what I'm writing and maybe you can tell me what I'm doing wrong:

root# find . -inum 2955126 -exec rm '{}' \;

is what I entered into the terminal, and when I do so all I get is this:

find:

and then it IMMEDIATELY skips to the next line of command. I have also tried the above command without the ending semicolon with the same result as well as replacing the two brackets with a name for the file...What am I doing wrong?

Thanks again for all the help provided thus far!

The whole idea of the command was, that you do not have to type the
filename (it had wierd characters, right?). Are you sure you typed

cd "the directory where the file is" ?

That is what the "." stand for.

BTW: Do you have OSX 10.4.3 ? It's hard disk tool can fix even mounted
disks, so it might do something to the file.
 
Make sure you type:

cd ~yourname/Desktop

and hit enter before you type:

find . -inum 2955126 -exec rm '{}' \;
 
Back
Top