Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: File locking; downgrade an exclusive to a shared lock

by The_Dj (Sexton)
on Jul 12, 2013 at 05:47 UTC ( #1043878=note: print w/replies, xml ) Need Help??


in reply to Re: File locking; downgrade an exclusive to a shared lock
in thread File locking; downgrade an exclusive to a shared lock

+1 to lateral thinking.
-5 to server usability.
  • Comment on Re^2: File locking; downgrade an exclusive to a shared lock

Replies are listed 'Best First'.
Re^3: File locking; downgrade an exclusive to a shared lock
by hippo (Bishop) on Jul 12, 2013 at 09:13 UTC

    Another lateral approach, then. Add into your script a write of the PID to a second, non-locked file after it has successfully gained the exclusive lock. Then your kill-script just needs to read the second, unlocked file and compare its timestamp to that of the locked file (to make sure the second file is not stale).

    Caveat: I'm not a Windows user, so this may be no use at all on that platform.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (1)
As of 2023-06-03 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (17 votes). Check out past polls.

    Notices?