/tmp... (null pathnames)

BALDWIN mike at whuxl.UUCP
Tue Nov 12 10:26:24 AEST 1985


> In the name "/usr/bin/glumph", each file or directory (node) is
> named "/" or "".  That's all.  It's the connection ("link")
> between one and the next that is named "usr" or "bin" or "glumph".
> The picture (attempted later below) that labels nodes with these
> names should always label links with these names!  But, this is
> why multiple "/"s mean the same as one (or none, where appropriate).
> I just said they were "names", but they are actually separators for
> the real names, the names of the links.  And if there is nothing
> between them, then they reference the null link "", which goes
> nowhere (hence "" is equivalent in some systems to ".").

Um sorry, but you're wrong.  The kernel does *not* treat a///b as
a/""/""/b; if you look in nami.c, there a loop that skips multiple
slashes.  So /// == / is not because of "" magic, it's just what
the code does.  Directories being named "/" or "" just doesn't wash.
If you're talking about inodes, dirs don't have any names at all.
This is how you *really* get to ///usr///bin///glumph///:

	path starts with / so start in root dir [skip /'s]
	get inode for entry named "usr" [skip /'s]
	make sure it's a dir, get inode for entry named "bin" [skip /'s]
	make sure it's a dir, get inode for entry named "glumph" [skip /'s]
	no more path, so return

Anyway, all I really wanted to say was that a///b has nothing to
do with null names.
-- 
						Michael Baldwin
						{at&t}!whuxl!mike



More information about the Comp.unix.wizards mailing list