home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!crdgw1!rdsunx.crd.ge.com!rdsunx!barnett
- From: barnett@grymoire.crd.ge.com (Bruce Barnett)
- Newsgroups: comp.unix.wizards
- Subject: Re: The Problem with UNIX
- Message-ID: <BARNETT.92Nov13103027@grymoire.crd.ge.com>
- Date: 13 Nov 92 15:30:27 GMT
- References: <96927@netnews.upenn.edu> <1992Nov11.210729.11676@cs.wisc.edu>
- <BARNETT.92Nov12092045@grymoire.crd.ge.com>
- <1992Nov12.231845.14014@cs.wisc.edu>
- Sender: usenet@crd.ge.com (Required for NNTP)
- Reply-To: barnett@crdgw1.ge.com
- Organization: GE Corp. R & D, Schenectady, NY
- Lines: 42
- In-Reply-To: so@brownie.cs.wisc.edu's message of Thu, 12 Nov 1992 23:18:45 GMT
- Nntp-Posting-Host: grymoire.crd.ge.com
-
- In article <1992Nov12.231845.14014@cs.wisc.edu> so@brownie.cs.wisc.edu (Bryan S. So) writes:
- > I propose a real solution to this problem. Change the internal
- > policy of UNIX, so that when any file is used as both input and
- > output, like
-
- > cat a b > a
- > or cat a b > b
-
- >UNIX should read and buffer all input before opening the output
- >with "w".
-
- Maybe. Perhaps the command was a typo, and the user didn't want
- to change "b". Perhaps UNIX should use version numbers, like VMS. That
- also solves both problems. Maybe UNIX should have an "undo" facility
- for all file operations. Maybe cat should be able to read "b" while
- it's getting larger (i.e. during the shell command). What about
-
- tail -f b > b
-
- Go back to "cat a b >b". Given three different responses:
-
- 1. deleting forever the contents of b
- 2. giving the user an error message
- 3. prepending a to b
-
- I argue that #2 is the best choice.
-
- Number 1 is bad. Number 2 is safe. Number 3 may or may not be what the
- user wanted to do. Given that it is not clear what the user expects
- "cat a b >b" to do, I believe a better answer is to simply tell the
- user that this might be an error on their part. Anyone who understands
- the implications of "cat a b >b" ought to be able to understand how to
- get around it. The only time it is a REAL problem is when the size of
- files a + b are greater than the amount of free disk space. At this
- time, the user should be VERY CAREFUL about the implications of the
- operation.
-
- Suppose the disk fills up while the new "b" is being created. What
- happens afterwards? Is the new "b" deleted? Or the old one?
-
- --
- Bruce Barnett <barnett@crd.ge.com> uunet!crdgw1!barnett
-