Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: use die with flock

by particle (Vicar)
on Jul 24, 2003 at 15:11 UTC ( [id://277572]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://277572]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-29 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found