Subject: Re: Posix.1 compat: "" == ENOENT. **why**?
To: Graham, James <>
From: John F. Woods <>
List: current-users
Date: 04/08/1997 16:50:30
> Pardon me, but why in the name of <insert deific figure here> would
> we want "" == ENOENT in pathname lookups?
> What does it _gain_?

POSIX compatability, the ability for developers to write their programs once
instead of getting to relive their youth by spending their golden years adding
layer after layer of #ifdefs for subtle variations of the same old code to
their programs.

Why did POSIX choose this?  Because the evil hordes of AT&T won that argument,
apparently.  (Originally POSIX offered a choice, with (I think) a pathconf()
gimmick to tell the difference; however, that was many years ago, and it has
apparently dropped out.  It's probably better that POSIX finally grew up and
started *making* choices, even if bad ones; the original agreement-to-disagree
version was nearly useless.)

Who could possibly prefer this?  A story:  when I worked on a non-UNIX
operating system that was being brought into conformance with SVID and
POSIX, one of our customers (one of our BIG customers) complained bitterly
about the "bug" we had that a zero-length string would open the current
working directory.  You see, they had some code that went (approximately)

	do {
		printf("Filename? ");
		if ((f = fopen(namebuf, "r")) == NULL) break;
	} while (1);

and they wanted the fopen() to return an error so they could break out of the
loop.  So, I went and made the change.  (Did I mention they were a BIG

So, who could possibly prefer this?  Obviously, the cripplingly brain damaged.