Funny filenames: in the nick of time!

Guy Harris guy at sun.uucp
Thu Jun 20 18:29:30 AEST 1985


> Thanks for all the replies; I'll summarize here and add a wrinkle.
> Basically, if you have file names with the eighth bit set, then nothing
> except a clri followed by a fsck will get rid of it.  In 2.8BSD, none
> of the various versions of "rm -i", "rm -f", "rm *", "rm -r", etc. work.
> ... My only remaining question:  why in the world does UNIX allow
> file names to be created that cannot be referred to?  Some of unlink's
> fancy protection should be copied over to whatever creates directory
> entries.

The UNIX kernel doesn't allow file names to be created that cannot be
referred to.  Except in 4.2BSD, however, it *does* allow file names to be
created that cannot be conveniently referred to using any of the current
UNIX shells.  Both the Bourne and C shells (and, I think, the V6 shell; I
don't know about the Korn shell) use the eighth bit internally as a quoting
indicator, and strip it off before passing arguments to commands.  As such,
the only way to access those files is to get the pathname into a program
using something other than the shell.

There may be a problem in 2.9BSD that permits you to create files with
characters in their names with their eighth bit on, but not to delete them.
V7, 4.1BSD, System III, and System V permit you to create them and delete
them.

If a 8-bit character set is chosen for UNIX's use in international
environments, somebody's going to have to fix the shells (and rip the code
out of 4.2BSD that disallows characters with their eighth bit on in file
names).

	Guy Harris



More information about the Comp.unix mailing list