Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!munnari.oz.au!manuel!cmf851 From: cmf851@anu.oz.au (Albert Langer) Newsgroups: comp.unix.sysv386 Subject: Re: cu/ecu through TCP/IP (plus ecu porting status) Message-ID: <1991May21.132134.4781@newshost.anu.edu.au> Date: 21 May 91 13:21:34 GMT References: <1991May16.154418.24131@chinet.chi.il.us> <1061@aega84.UUCP> <1991May17.171141.27309@chinet.chi.il.us> Sender: news@newshost.anu.edu.au Organization: Computer Services Centre, Australian National University, Canberra, Australia. Lines: 20 In article <1991May17.171141.27309@chinet.chi.il.us> les@chinet.chi.il.us (Leslie Mikesell) writes: >I'm pretty sure it isn't possible to do locks right in a shell script. >Creating a tmp file and using /etc/link to attempt to rename it to >the agreed-upon lockfile name is OK if it works, but you can never >safely test or remove an existing file. Some version of ln might >do what you want, but SysVr3 removes the target before attempting the >new link. I was under the impression it is safe to use mkdir since unlike linking a file, that is atomic. Anyone disagree? e.g.: [ mkdir $lockdir ] || echo "Already locked" -- Opinions disclaimed (Authoritative answer from opinion server) Header reply address wrong. Use cmf851@csc2.anu.edu.au