[Wellington-pm] perl -f check failed

Jethro Carr jethro.carr at jethrocarr.com
Tue Jul 20 20:33:30 PDT 2010


On Wed, 2010-07-21 at 15:23 +1200, Grant McLean wrote:
> > Essentially the script creates a number of text files whilst running and
> > checks if any exist using -f - if they do, it knows to use a different
> > name for the new file.
> 
> That sounds like a classic race condition.  If you check whether the
> file exists before you create it then it's possible that another process
> might create it between the time your check returns false and when you
> create the file. 

thanks Grant,

Good thinking, but one I've already checked - no other script was
running at that stage. :-(

(The script uses a lock file to enforce a single instance which I've
confirmed by checking the logs for any evidence of a second process)

regards,
jethro

-- 
Jethro Carr
www.jethrocarr.com/index.php?cms=blog
www.amberdms.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mail.pm.org/pipermail/wellington-pm/attachments/20100721/5afeffa4/attachment.bin>


More information about the Wellington-pm mailing list