in reply to use die with flock

your locking method is problematic. the file may be locked by someone else, or modified after you open the file, but before you lock it.

you can solve this and other file locking problems using the techniques outlined in Dominus's file locking tricks and traps.

~Particle *accelerates*

Replies are listed 'Best First'.
Re: use die with flock
by Abigail-II (Bishop) on Jul 24, 2003 at 15:21 UTC
    No, the problem would only be there if you open the file for writing. But opening the file for append doesn't truncate the file, and the system (well, at least a Unix system) will seek to the end before you perform a write.

    Abigail