Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: Ghost file Message-ID: <526@auspex.UUCP> Date: 27 Nov 88 05:09:41 GMT References: <17529@adm.BRL.MIL> <8430@alice.UUCP> <169@pinn.UUCP> <303@bilver.UUCP> <489@auspex.UUCP> <550@dutrun.UUCP> <512@auspex.UUCP> <556@dutrun.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 39 >Who assumes "\0" is a synonym for "." ? The kernel, open(2),... ? In SunOS (and systems that have adopted the SunOS VFS code), the routine "lookuppn". In 4.3BSD, the routine "namei". Both are in the kernel (as is "open()", which when calls ends up causing either "lookuppn" or "namei" to be called). >The file I created was shown by ls -l as "-rw-r---- ?", That doesn't look like "". That looks like a file with some non-printable character. "ls" in all UNIX implementations I know of treats file names as character strings, which means it treats '\0' as an end-of-string character, not a non-printable character; there's some real character there, not just a '\0'. >but file(1) said it was a directory. It was in my home directory, >and cd "" kept me there. Since "" is a synonym for "." in SunOS, 'cd ""' and 'cd .' do the same thing, namely keep you in the current directory. Similarly, 'file ""' will, just like 'file .', tell you it's a directory. It sounds like ELM "defaulted" to an uninitialized string which, in this particular case, contained a non-printable character followed by a '\0' (assuming that the "ls -l" in question did, in fact, show only one '?'; there could, presumably, have been blanks before and/or after it). You then assumed it actually created a file with a null name, and tried various operations on "". "rm -i *" probably succeeded, and gave the impression that it removed a file with a null name, because it actually tried removing a file with a name like "\001", and when it printed "\001" your terminal did nothing with the "\001". In other words, "rm"s message was something like rm: remove (\001)? which appeared as rm: remove ?