Article View: comp.unix.programmer
Article #1269Re: Determining if an existant file is open
From: Dan Bernstein
Date: Wed, 21 Nov 1990 19:42
Date: Wed, 21 Nov 1990 19:42
17 lines
1288 bytes
1288 bytes
In article <274975C4.21C@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: > According to rwhite@nusdecs.uucp (0257014-Robert White(140)): > >Do the "put process number in lock file" thing as in uucp. > This approach cannot be used reliably without either (1) having a lock > held forever by a dead process, which I find unacceptable, or (2) > using a kernel locking call, which renders the pid file redundant. It can be used reliably if you put information like pid and date into the name of the lock file. > For you doubters: Once you've determined that a lock file is stale and > you want to unlink() it, how do you know the lock file hasn't been > replaced in between the decision to unlink() and the unlink() itself? The old name will never be reused, so there's no danger of replacement. ---Dan
Technical Details
Message-ID:
<26251:Nov2119:42:1090@kramden.acf.nyu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstndReferences:
<1990Nov16.023110.1305@csun.edu> <1990Nov16.200945.14468@nusdecs.uucp> <274975C4.21C@tct.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.programmer Subject: Re: Determining if an existant file is open Message-ID: <26251:Nov2119:42:1090@kramden.acf.nyu.edu> Date: 21 Nov 90 19:42:10 GMT References: <1990Nov16.023110.1305@csun.edu> <1990Nov16.200945.14468@nusdecs.uucp> <274975C4.21C@tct.uucp> Organization: IR Lines: 17