# Deleting files with umlaute in name



## LordCoven (Sep 4, 2002)

Hey there,

Well, this has me flummuxed:

I got a tar from a mate which contained files with umlaute in. As I extracted the tar it said that it was not able to create the files (apparently they already existed - but they didn't ...)
Then I tried to delete the directory which contained those files. But it said it wasn't empty. When I cd into the directory and do an ls, I get loads of:
ls: My?? File - 1.0.txt: No such file or directory
messages for each entry. If I do an rm * (or sudo rm -Rf *) I get the same messages.
The Finder doesn't show any files in that directory - but when I move the folder to the trash and then try and empty trash, this also fails because it can't find the files to delete. ARGH!

Has anyone got any suggestions what I might try??

Thanks,

C


----------



## fddi1 (Sep 4, 2002)

Let me make sure that I understand you correctly.  You have some files in a directory.  You can see them, but can't delete them.  If that's the case, try to delete them by the inode.

First of all, do a *ls -i* .  It will give you a number that associates with each file.   Then, do a *
find . -inum <inode number> -exec rm '{}' ';'*  to delete the file by its inode number.


----------



## LordCoven (Sep 5, 2002)

.... that I can't view the files with ls.
Like I said, when I do an ls, I get:
ls: My??File_1.0.txt: no such file or directory
for every file in the directory. Thing is, I'm not sure the files are actually there - but the file table seems to have something there for them. When I do a du or check the directory's info in the Finder it says that everything is of zero length.
I *can't* see those files in the Finder.
If I do an rm My* or rm * or anything similar, I get:
rm: My??File_1.0.txt: no such file or directory

The two question marks are where the umlaut is. I've tried tinkering with the locale settings to see if I could get the terminal to display the umlaut instead of giving me the question marks, but to no avail.

Curiously, when I do a tab completion (I'm using bash) it completes the names 'correctly' ... that is by showing the umlaut character escaped \355\265..etc. But even using this notation it can't find the files to delete them.

ARGH! Damn those Germans! Why couldn't they just use sensible characters like us Brits! (BTW: That *was* a joke - I live in Germany and love the people here dearly!!! ) (esp. the beer )))) (just not their weird-arsed characters ))

Oh - and I also tried setting the character set to different things in the terminal preferences. Also to no avail. And I tried ssh'ing into the system from various other systems (including German ones) ... again to no avail. 

Cheers,

C


----------



## lurk (Sep 5, 2002)

Howdy,

This has also bitten me, save my umlaut was Finnish   The good news is that I got rid of the file! The bad news is that I had to boot into os9 to do it.  I tried all sorts of tricks including some serious Unix black magic before that to no avail.

My guess was that there is a screw up with the unicode translation for the file names.  Tar is somehow writing a file name to the disk in somethnig like Latin-1 and then it is being read back as a malformed UTF-8 string which causes OS X to barf.

If you don't have access to OS9 on your box and there is nothing else in the directory which you would like to keep you can try the final "big hammer" I did not use.



> Warning Warning Warning Potentially Super Dangerous Stuff Follows





> dd if=/dev/zero of=/dir/to/die



After this do a *sync* and powercycle the machine to force a *fsck* on startup.  I never said it was pretty but it _may_ work, that is it would have worked on HP-UX and some of the other old unix boxes I have used in the past.  I don't think that it would work on Linux now days.  Furthermore, I don't know how it will interract with a HFS+ formatted partition.

I guess the point is that you will either get a you-can't-do-that type error, the file will be gone , or the file system will be munched 

At any rate tell us if you try it and what the results were.  Me I didn't have the guts to do it  once I had the OS9 route.

-Eric
P.S. I did mention this was risky (maybe?)


----------



## LordCoven (Sep 5, 2002)

Hey there,

Woah. Sounds a bit risky 
I think I'd rather try the OS9 route first (I *think* I still have it on my drive ) ... could you outline what you did there (unless it was simply going into the Finder and deleting it )

Cheers,

C


----------



## lurk (Sep 5, 2002)

Sorry about the lack of detail, it was just that simple go to the finder and delete it.  The name will have a lot of # garbage in it.  Make sure you empty the trash while in OS9 so that it really off the disk.

-Eric


----------



## LordCoven (Sep 5, 2002)

I'll give that a go later 

C


----------



## lethe (Sep 5, 2002)

try emacs


```
$ emacs /[I]path[/I]/[I]to[/I]/[I]directory[/I]
```

emacs has a directory mode which will let you delete files in a directory, and it is smarter at understanding characters and stuff.


if that doesn t work, then you ve got a bug.  submit it to apple bug report.


----------



## lurk (Sep 5, 2002)

For the record when this happend to me I tried the emacs route and it also failed.  It is not so much a problem with getting the right magic escape sequence right as bug in the OS filesystem layer.  Nothing works right on this type of directory ls won't even list all the files and the Finder under OS X won't even display them.

As I vaguely recall I found a reference to a bug rebort somewhere but I did not submit one myself.  Someone should just to tally up a couple of votes for getting it fixed if nothing else.  i'll see if I can find a toxic tar file which does that here in my copious spare time 

-Eric


----------



## LordCoven (Sep 6, 2002)

Just been back to OS9 for a quick trip down memory lane and a quick lesson (for OS X) in how to remove files properly 

Thanks again,

C


----------



## xegan (Sep 6, 2002)

Same thing here, but with a file called "."
The directory had an extra "." file..
Tried everything I knew to zap it.
Had to go into OS9 to delete it.


----------

