home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!auspex-gw!guy
- From: guy@Auspex.COM (Guy Harris)
- Newsgroups: comp.unix.questions
- Subject: Re: Nothing is a directory?
- Message-ID: <14487@auspex-gw.auspex.com>
- Date: 5 Sep 92 19:03:13 GMT
- References: <1992Sep3.231718.16061@sadtler.com>
- Sender: news@auspex-gw.auspex.com
- Organization: Auspex Systems, Santa Clara
- Lines: 45
- Nntp-Posting-Host: bootme.auspex.com
-
- >So, who is right? Is nothing a directory?
-
- It depends on the flavor of UNIX you're running.
-
- In the original Research versions, such as V7, a null string referred to
- the *current* directory - i.e., "", as a pathname, was equivalent to "."
- - so yes, in that sense, in systems that work the way those versions of
- UNIX do, nothing *is* a directory.
-
- The groups doing systems such as SV preferred to make the null string,
- as a pathname, not refer to any file. In systems that work the way
- those versions of UNIX do, nothing *isn't* a directory.
-
- POSIX 1003.1 seems to specify the SV behavior. As such, more and more
- systems will, at least in their POSIX-compliant environments, behave the
- way your SGI system behaves (IRIX is more SVish than V7ish).
-
- SunOS releases prior to 5.0 have, as their "native" environment, an
- environment that generally chooses to follow BSD rather than SV; BSD
- chose to follow V7 rather than SV, so a null string was equivalent to
- ".". In later pre-5.0 releases, the System V environment versions of
- routines that take pathnames as arguments check for null strings and
- behave in an SV-style fashion (or they rely on one of the routines they
- call to do so).
-
- In SunOS 5.0, the "native" environment is SVish, and behaves in an
- SV-style fashion; the BSD environment appears to still handle null
- strings in the fashion that V7 and older BSD systems do.
-
- Presumably, 4.4BSD will behave in an SV-style fashion, rather than a
- V7/BSD-style fashion, as it's intended to be POSIX-compliant, and POSIX
- specifies the SV-style behavior.
-
- However, even if you're running in the SV environment, the pre-5.0
- "test" command behaves in a V7/BSD-ish fashion in that regard; the shell
- was built in the BSD environment. The 5.0 version vehaves in an SV-ish
- fashion, even if you're running in the BSD environment; the shell was
- built in the SV environment.
-
- The bottom line:
-
- until everybody's POSIX 1003.1-compliant, be prepared for a null
- string to refer to the current directory; if need be, check for
- a null string before using it.
-
-