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

Re^3: File lock demo

by davido (Cardinal)
on Apr 21, 2021 at 20:35 UTC ( [id://11131545]=note: print w/replies, xml ) Need Help??


in reply to Re^2: File lock demo
in thread File lock demo

Empty lock files certainly aren't wrong either. MJD's talk discusses how many problems can be solved by using a lockfile that is different from the target working files. And that's what you're doing. I mostly just didn't want someone seeing open my $fh, '>', ...; and then flock, and think this idiom will translate well to locking an output file that they intend to write to.


Dave

Replies are listed 'Best First'.
Re^4: File lock demo
by LanX (Saint) on Apr 21, 2021 at 21:07 UTC
    > and think this idiom will translate well to locking an output file that they intend to write to.

    Yeah, I have to make that clear to my colleagues. My concern was the warning in the docs that locking might fail if the lock-file is not opened for writing.

    And the side effects on Win are giving me a hard time when following recipes born on Linux.

    Thanks for sharing those links! :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found