home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3145 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.3 KB  |  30 lines

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