From: Linus Torvalds (torvalds@klaava.Helsinki.FI)
Date: 07/12/93


From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
Subject: Re: File System bug..?
Date: 12 Jul 1993 18:31:13 +0300


[ Tring again after cancelling my first try: it seems the 8-bit chars in
  my first post messed up something.. I hate to be proven correct quite
  that way ]

In article <mmourierCA1IxA.7v7@netcom.com> mmourier@netcom.com (Marcelo Mourier) writes:
>I'm running Linux 0.99.10 on an ext2 root file system. Trying to uudecode a
>corrupted uuencoded file, I ended up with a file named "begin image.jpg?" in
>the root directory (note the ' ' and '?' chars in the file name.) The file
>mode is --w--w-r-- (0224) and it's owned by root. As you can guess, the problem
>is that I can't get rid of the darn file! I even wrote a simple program that
>uses the stat(), chmod(), and unlink() system calls directly, but every single
>one of them fails with the infamus "No such file or directory" (ENOENT) error
>message :-(
>
>The weird thing is "then, how did uudecode managed to create a file with that
>name?!" Browsing the files in linux/fs I noticed that open() uses open_namei(),
>while stat(), chmod(), etc. uses namei(). Could open_namei() and namei() have
>different semantics..? Any help will be appreciated!

The '?' is probably any random 8-bit character: it's ls way of telling
you it doesn't know how to print the char. You can do a

        # ls -l --literal

to see the character in all it's glory - in case it's some weird char,
you might also want to use 'less' or 'od' on the output of ls --literal,
as you may not otherwise be able to see the char.

As to removing it.. It works the obvious way for me, but I have a
pre-version of bash-1.13 which is 8-bit clean, so I just hit 'tab' and
it will be expanded correctly. This should work in all cases:

        # rm -ri `pwd`

(note that you'll have to use `pwd` or the actual name instead of just
'.', as that one fails for GNU rm with a EINVAL error (misfeature of GNU
rm, I think). Also, be sure to answer 'n' to all files you *don't* want
to remove :-p

The linux kernel itself is 8-bit clean, but a lot of unix programs
aren't (including the newsreader I'm on now, it seems), so these
problems are somewhat hard to get a grip on.

                Linus