Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Mysterious Disapperance of file contents

by bobn (Chaplain)
on Aug 29, 2003 at 02:45 UTC ( [id://287576]=note: print w/replies, xml ) Need Help??


in reply to Re: Mysterious Disapperance of file contents
in thread Mysterious Disapperance of file contents

That was my first thought, (hence my award-winning post above), but after reading the doc on flock, it appears that purpose of the flock isn't to stop the second program from opening the file - instead it stops the second program from obtaining the lock - the second program's flock(HANDLE, LOCK_EX) blocks until the first program issues flock(HANDLE, LOCK_UN).

The doc on flock shows a sequence much like that used by the OP, but without use of a spearate seamphore file.

Testing things very similar to the OP's code seems to work as expected. I don't see the issue.

--Bob Niederman, http://bob-n.com

All code given here is UNTESTED unless otherwise stated.

  • Comment on Re: Re: Mysterious Disapperance of file contents

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found