🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #120

file locking in shell scripts

#120
From: Ronald van Loon
Date: Thu, 23 Jul 1992 12:43
16 lines
1179 bytes
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)
Technical Details
Message-ID: <1992Jul23.124327.20843@cv.ruu.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!alchemy!prisma!rvloon

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.shell,comp.unix.programmer
Path: arc1-ca.pugleaf.net!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