home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / wizards / 4791 < prev    next >
Encoding:
Text File  |  1992-11-18  |  2.6 KB  |  59 lines

  1. Newsgroups: comp.unix.wizards
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!mel.dit.csiro.au!yarra!bohra.cpg.oz.au!als
  3. From: als@kowari.cpsg.com.au (Anthony Shipman)
  4. Subject: Re: The Problem with UNIX
  5. Message-ID: <als.722149918@marloo.kowari.cpsg.com.au>
  6. Sender: news@bohra.cpg.oz.au (0000-news(0000))
  7. Organization: Computer Power Software
  8. References: <96927@netnews.upenn.edu> <1992Nov11.210729.11676@cs.wisc.edu> <BARNETT.92Nov12092045@grymoire.crd.ge.com> <1992Nov13.030529.6207@bilver.uucp> <aldavi01.721645237@starbase.spd.louisville.edu>
  9. Date: Thu, 19 Nov 1992 05:11:58 GMT
  10. Lines: 47
  11.  
  12. aldavi01@starbase.spd.louisville.edu (Arlie Davis) writes:
  13.  
  14. >In <1992Nov13.030529.6207@bilver.uucp> bill@bilver.uucp (Bill Vermillion) writes:
  15.  
  16. >> And some of the lastest bourne shells also have fixed it.  In sysv.3.2
  17. >> from Esix if I type
  18.  
  19. >> cat a b > b    I get this result
  20.  
  21. >> cat: input/output files 'b' identical
  22.  
  23. >> So after a decade these have been solved.
  24.  
  25. >This was a fix to cat, not any of the shells.  And b still gets clobbered.
  26. >It *is* an improvement, though, and mine acts the same way.
  27.  
  28. >I responded in email to Bryan So that a decent solution is a (hypothetical
  29. >but terribly simple) program called "buffer" would reads its stdin until EOF,
  30. >then opens and writes all to the filename in argv[1].  So, "cat a b > b"
  31. >becomes "cat a b | buffer b".  He seemed to like the suggestion.
  32.  
  33. TOPS10 did something like this automatically.  If program A started
  34. reading a file and then program B opened the file for writing (not
  35. updating) then the OS created a new version of the file internally and
  36. the reader would continue to see the old version until it closed the
  37. file.  Then the old version would be deleted and the next read would
  38. get the new version.  Readers starting after program B would see the
  39. new (possibly incomplete) version.
  40.  
  41. The UNIX method seems like it might have been one of the
  42. simplifications done when cutting down from mainframe OSes and now we
  43. are stuck with it.
  44.  
  45. In my own thought experiments on OS design I divide the file opening
  46. process into a bind phase and a connect phase, analogous to opening a
  47. bsd socket.
  48.  
  49. A hypothetical UNIX-like OS with TOPS10 version behaviour would have to
  50. defer the opening of stdout until in cat.  eg the shell binds the file
  51. name to stdout and cat completes the open, after it has opened its
  52. input files.
  53.  
  54. --
  55. Anthony Shipman                 "You've got to be taught before it's too late,
  56. CP Software Export Pty Ltd,      Before you are six or seven or eight,
  57. 19 Cato St., East Hawthorn,      To hate all the people your relatives hate,
  58. Melbourne, Australia, 3121       You've got to be carefully taught."  R&H
  59.