home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.24 / text0049.txt < prev    next >
Encoding:
Text File  |  1991-09-03  |  1.6 KB  |  41 lines

  1. Submitted-by: mengel@fnal.fnal.gov (Marc W. Mengel)
  2.  
  3. brnstnd@KRAMDEN.ACF.NYU.EDU (Dan Bernstein) writes:
  4.  
  5. >Submitted-by: brnstnd@KRAMDEN.ACF.NYU.EDU (Dan Bernstein)
  6.  
  7. >Under BSD, you can easily set up a /inst/bin directory with symlinks to
  8. >every officially ``installed'' executable. Users can then have /inst/bin
  9. >in their paths instead of all the physical directories like /bin, /etc,
  10. >/usr/bin, /usr/ucb, etc. Although the directory is large, the time for
  11. >several failing execve()s is much larger than the time for searching one
  12. >directory (especially with path caching as in BSD 4.3).
  13.  
  14.     Of course, you can't run /bin/ls there without it blowing
  15.     up, and the directory search time is much more expensive
  16.     than split directories.  Also none of your modern shells
  17.     (SysV sh, csh, ksh, bash, etc.) do mulitple execve()s,
  18.     they keep a hash table.  Most current UNIX implementations
  19.     do not handle large (>200 files) directories well at all.
  20.     Many standard unix utilities choke on huge directories.
  21.  
  22.     Due to the filesystem implementation, things like stat-ing
  23.     all the files in a directory turn out to be order(n**2),
  24.     making lots of operations slower in non-obvious ways.
  25.  
  26. >Even on System V, you can put hard links in /inst/bin, and when an
  27. >executable is on a different device you can set up a shell script which
  28. >execs the real executable. It's *still* more efficient, on the average,
  29. >than all the failing execve()s. Try it if you don't believe me.
  30.  
  31.     Well, actually in general you have to write a little
  32.     stub executable, since you can't exec() shell scripts
  33.     on Sys. V systems previous to Release 4...
  34. -------
  35. Marc Mengel
  36. mengel@fnal.fnal.gov
  37.  
  38.  
  39. Volume-Number: Volume 24, Number 50
  40.  
  41.