From: Morgan Date: 2005-09-13T08:26:49+09:00 Subject: Re: Adventures in html decoding. "Ara.T.Howard" wrote: >O_EXCL is broken on nfs: > > O_EXCL When used with O_CREAT, if the file already exists it is an > error > and the open will fail. In this context, a symbolic link exists, > regardless of > where its points to. O_EXCL is broken on NFS file systems, programs which > rely on it for performing lock- ing tasks will contain a race > condition. The > solution for per- forming atomic file locking using a lockfile is to > create a unique file on the same > fs (e.g., incorporating hostname and pid), > use link(2) to make a link to the lockfile. If link() returns 0, > the lock > is successful. Otherwise, use stat(2) on the unique file to check > if its > link count has increased to 2, in which case the lock is also successful. ... And I barely understood a word of that. `.` Does that mean it won't properly perform the "don't clobber an existing file" purpose I'm using it for? -Morgan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 09/10/2005