Confused file name in directory

ron at brl-sem.UUCP ron at brl-sem.UUCP
Thu Feb 26 13:39:27 AEST 1987


In article <2136 at ptsfa.UUCP>, ssl at ptsfa.UUCP (Sam Lok) writes:
> But as a last to the last resort, if you don't really want to get rid
> of things, I'll try this before 'clri':
> 	1. make sure there's only one directory and/or filename start
> 	   with D
> 	2. then 'mv D* goodname'

THIS WILL NOT WORK.

The problem is that the UNIX directory structure is exactly 14 characters
long and some older versions of UNIX (version 7 which XENIX is based on,
don't know if System V has the same problem) compare all the 14 characters
to do a match.  They expect all the unused characters to have nulls in them
rather than be null terminated.  There is NOTHING you can do through the
UNIX file system that will reference this file.  Think about it.  D*
would just expand to "D".  Mv knows nothing special about "*", that is
expanded by the  shell and passed as an argument to mv.  You still can't
pass that to unlink or open because the null terminates the string.

-Ron



More information about the Comp.unix.wizards mailing list