Subject: Re: What should stat("",&fs) return?
To: Peter Seebach <seebs@solon.com>
From: Chris G Demetriou <Chris_G_Demetriou@UX2.SP.CS.CMU.EDU>
List: current-users
Date: 05/30/1996 11:26:16
[ My, i'm feeling anal-retentive today... ]

> There are some cases in which an empty string may be treated as the
> current directory, or so I seem to recall.

POSIX (.1b-1993) explicitly states (Page 27, line 662 of Section 2):

	A null pathname is invalid.


Now, it doesn't explicitly say what a "null pathname" is, but it does
say that a pathname is:

	A string that is used to identify a file.

(p. 18, line 316 of Section 2), that to determine what a "null string"
is one should see the definition of "empty string" (p. 17, line 285 of
Section 2), and there one finds:

	2.2.2.31 empty string [null string]: A character array whose
	first element is the null character.

(p. 14, lines 174-175 of Section 2).

So, giving stat() "" is really disallowed.  8-)


You're probably thinking of the pathname definition and resolution
rules, which say that multiple //'s are compressible into a single /
(except, in some implementations, at the start of an absolute
pathname), and that pathnames which describe directories may end in
/...



chris