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