home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!sun-barr!ames!agate!usenet.ins.cwru.edu!odin!chet
- From: chet@odin.INS.CWRU.Edu (Chet Ramey)
- Subject: Re: file locking in shell scripts
- Message-ID: <1992Jul27.122124.28325@usenet.ins.cwru.edu>
- Sender: news@usenet.ins.cwru.edu
- Nntp-Posting-Host: odin.ins.cwru.edu
- Organization: Case Western Reserve University, Cleveland, OH (USA)
- References: <1992Jul23.124327.20843@cv.ruu.nl> <FRIEDMAN.92Jul24055302@nutrimat.gnu.ai.mit.edu>
- Date: Mon, 27 Jul 92 12:21:24 GMT
- Lines: 18
-
- In article <FRIEDMAN.92Jul24055302@nutrimat.gnu.ai.mit.edu> friedman@gnu.ai.mit.edu (Noah Friedman) writes:
-
- >suggest a patch to bash that will make the noclobber feature a little more
- >reliable (it presently does a stat and then an open, which results in a
- >race condition), and then it will be possible to do the following safely:
-
- Race condition or no, the call to stat has to be in there. Noclobber works
- only for regular files, and this has to be checked before an open is
- attempted. Were this check not in there, you'd find that after setting
- -o noclobber you'd no longer be able to redirect anything to /dev/null.
-
- Chet
- --
- ``The use of history as therapy means the corruption of history as history.''
- -- Arthur Schlesinger
-
- Chet Ramey, Case Western Reserve University Internet: chet@po.CWRU.Edu
-