home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3102 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.2 KB

  1. Xref: sparky comp.unix.shell:3102 comp.unix.programmer:3861
  2. Newsgroups: comp.unix.shell,comp.unix.programmer
  3. Path: sparky!uunet!mcsun!sun4nl!alchemy!prisma!rvloon
  4. From: rvloon@cv.ruu.nl (Ronald van Loon)
  5. Subject: file locking in shell scripts
  6. Originator: rvloon@wodan.cv.ruu.nl
  7. Sender: usenet@cv.ruu.nl (Usenet Network)
  8. Message-ID: <1992Jul23.124327.20843@cv.ruu.nl>
  9. Date: Thu, 23 Jul 1992 12:43:27 GMT
  10. Nntp-Posting-Host: wodan.cv.ruu.nl
  11. Organization: University of Utrecht, 3D Computer Vision Research Group
  12. Lines: 16
  13.  
  14. I have the following problems:
  15.  
  16. Somewhere on our system is a log-file. This logfile is used to gather
  17. statistical information. However, it is possible that people write to the file
  18. at the same time, thus resulting in either the merge of the input-streams or
  19. total garbage in the file.
  20.  
  21. How can I - within a shell script - lock the file exclusive for writing ? If
  22. that's not possible, what do I need to use to do so from C, for example ?
  23.  
  24. Thanks for your answers in advance.
  25. -- 
  26. Ronald van Loon (rvloon@cv.ruu.nl) 3DCV Group, Utrecht, The Netherlands.
  27.  
  28. Insanity is not bad in itself as long as there is a system to it. (H.Liberg)
  29. Healthy absurdism once in a while has never hurt anybody (me)
  30.