Funny filenames: in the nick of time!

jeffrey w percival jwp at uwmacc.UUCP
Tue Jun 18 05:08:03 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.

I learned this just in time, though.  My original posting was prompted
by the existence of 2 or 3 funny files that had been hanging around for
months.  Well, no sooner did I learn how to get rid of them, when a user
decided she wanted to run "split" on her mail box, and she wanted it
split into 2 pieces, so she typed "split -2 mbox".  Her mbox was 6000
lines long.  split started out with "xaa", went through to "xzz", then
proceeded with x{a, x|a, x}a, x~a, and so on off the ascii sequence, into
8-bit integers, finally stopping after creating over 2 *thousand* files
with the 8th bit set in file names.  Shell script time.  The only
problem with "ls -i > foo" to generate a command script to do a lot
of clri's is that on a '70, ls runs out of memory at around 470 files.
So we made a shell script to do 470 clri's, then a fsck -y, reboot,
new shell script, fsck -y, reboot, and so on, and so on, and so on...

Needless to say, we fixed split to stop when it ran out of legal file
names.  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.
-- 
	Jeff Percival ...!uwvax!uwmacc!jwp



More information about the Comp.unix mailing list