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

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!rutgers!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: <1992Nov18.020402.23061@cs.wisc.edu>
  6. Date: 18 Nov 92 02:04:02 GMT
  7. References: <BARNETT.92Nov12092045@grymoire.crd.ge.com> <1992Nov12.231845.14014@cs.wisc.edu> <Bxr6wq.7CM@mudos.ann-arbor.mi.us>
  8. Sender: news@cs.wisc.edu (The News)
  9. Organization: University of Wisconsin, Madison -- Computer Sciences Dept.
  10. Lines: 23
  11.  
  12. In response to my suggestion that the shell should help the user
  13. buffer "b" when it sees the command "cat a b > b",
  14. mju@mudos.ann-arbor.mi.us (Marc Unangst) writes:
  15.  
  16. >There are also problems with buffering the input.  What if the "b" is
  17. >a FIFO or a device, not a regular file?  In that case, "cat b > b" is
  18. >perfectly valid and not at all abnormal.  What if "b" is a Unix-domain
  19. >socket, and the program at the other end writes something and then
  20. >waits for a response before closing the file?  Your program will never
  21. >run, because Unix will be sitting there waiting to read the "rest" of
  22. >the input file before giving the program control.
  23.  
  24.  If "b" is a FIFO, it may make "cat b > b" syntactically or even
  25.  semantically valid.  But how would it make that psychologically
  26.  valid?
  27.  
  28.  I suppose "cat a > a" or some variance of it is documented 
  29.  somewhere as "pitfalls" and users warned.  So, whoever thought
  30.  up a FIFO "b", such that the proper usage is "cat b > b", is 
  31.  just absurd.  Can you give a practical application for such use?
  32.  
  33.  
  34. Bryan
  35.