home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / question / 10769 < prev    next >
Encoding:
Internet Message Format  |  1992-09-07  |  2.4 KB

  1. Path: sparky!uunet!auspex-gw!guy
  2. From: guy@Auspex.COM (Guy Harris)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: Nothing is a directory?
  5. Message-ID: <14487@auspex-gw.auspex.com>
  6. Date: 5 Sep 92 19:03:13 GMT
  7. References: <1992Sep3.231718.16061@sadtler.com>
  8. Sender: news@auspex-gw.auspex.com
  9. Organization: Auspex Systems, Santa Clara
  10. Lines: 45
  11. Nntp-Posting-Host: bootme.auspex.com
  12.  
  13. >So, who is right?  Is nothing a directory?
  14.  
  15. It depends on the flavor of UNIX you're running.
  16.  
  17. In the original Research versions, such as V7, a null string referred to
  18. the *current* directory - i.e., "", as a pathname, was equivalent to "."
  19. - so yes, in that sense, in systems that work the way those versions of
  20. UNIX do, nothing *is* a directory.
  21.  
  22. The groups doing systems such as SV preferred to make the null string,
  23. as a pathname, not refer to any file.  In systems that work the way
  24. those versions of UNIX do, nothing *isn't* a directory.
  25.  
  26. POSIX 1003.1 seems to specify the SV behavior.  As such, more and more
  27. systems will, at least in their POSIX-compliant environments, behave the
  28. way your SGI system behaves (IRIX is more SVish than V7ish).
  29.  
  30. SunOS releases prior to 5.0 have, as their "native" environment, an
  31. environment that generally chooses to follow BSD rather than SV; BSD
  32. chose to follow V7 rather than SV, so a null string was equivalent to
  33. ".".  In later pre-5.0 releases, the System V environment versions of
  34. routines that take pathnames as arguments check for null strings and
  35. behave in an SV-style fashion (or they rely on one of the routines they
  36. call to do so).
  37.  
  38. In SunOS 5.0, the "native" environment is SVish, and behaves in an
  39. SV-style fashion; the BSD environment appears to still handle null
  40. strings in the fashion that V7 and older BSD systems do.
  41.  
  42. Presumably, 4.4BSD will behave in an SV-style fashion, rather than a
  43. V7/BSD-style fashion, as it's intended to be POSIX-compliant, and POSIX
  44. specifies the SV-style behavior.
  45.  
  46. However, even if you're running in the SV environment, the pre-5.0
  47. "test" command behaves in a V7/BSD-ish fashion in that regard; the shell
  48. was built in the BSD environment.  The 5.0 version vehaves in an SV-ish
  49. fashion, even if you're running in the BSD environment; the shell was
  50. built in the SV environment.
  51.  
  52. The bottom line:
  53.  
  54.     until everybody's POSIX 1003.1-compliant, be prepared for a null
  55.     string to refer to the current directory; if need be, check for
  56.     a null string before using it.
  57.  
  58.