home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / wizards / 4641 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  1.5 KB

  1. Path: sparky!uunet!know!mips2!news.bbn.com!noc.near.net!nic.umass.edu!news.mtholyoke.edu!news.byu.edu!hamblin.math.byu.edu!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!uwm.edu!daffy!uwvax!brownie.cs.wisc.edu!so
  2. From: so@brownie.cs.wisc.edu (Bryan S. So)
  3. Newsgroups: comp.unix.wizards
  4. Subject: Re: The Problem with UNIX
  5. Message-ID: <1992Nov12.231845.14014@cs.wisc.edu>
  6. Date: 12 Nov 92 23:18:45 GMT
  7. References: <96927@netnews.upenn.edu> <1992Nov11.210729.11676@cs.wisc.edu> <BARNETT.92Nov12092045@grymoire.crd.ge.com>
  8. Sender: news@cs.wisc.edu (The News)
  9. Organization: University of Wisconsin, Madison -- Computer Sciences Dept.
  10. Lines: 34
  11.  
  12. Concerning "cat a b > b", barnett@crdgw1.ge.com writes:
  13.  
  14. >It has been solved. There are at least two solutions:
  15. >    1) Educate the user. After all the system did exactly what
  16. >        the user told it to do.
  17. >    2) in csh/tcsh, do "set noclobber"
  18. >
  19. >grymoire% set noclobber
  20. >grymoire% touch a b
  21. >grymoire% cat a b >b
  22. >b: File exists.
  23. >--
  24. >Bruce Barnett <barnett@crd.ge.com> uunet!crdgw1!barnett
  25.  
  26. No, the above are not solutions.  
  27.  
  28. 1. We should assume some stubborn users cannot be educated.  I
  29.    claim without proof such users exist.
  30.  
  31. 2. set noclobber is not a solution because a solution should
  32.    prepend a to b.  
  33.  
  34. I propose a real solution to this problem.  Change the internal
  35. policy of UNIX, so that when any file is used as both input and
  36. output, like
  37.  
  38.     cat a b > a
  39. or     cat a b > b
  40.  
  41. UNIX should read and buffer all input before opening the output
  42. with "w".
  43.  
  44.  
  45. Bryan
  46.