Flock and Sleep

2003-08-14 Thread Sara
(sub get_number { open(NUMBER,">>data.txt"); flock (NUMBER, 2); Do blah blah blah close (NUMBER); closing a file automatically removes the lock?? or should I have to unlock it by placing flock (NUMBER, 8); close (NUMBER); My second question is how I can delay the execution of a script (If two

Re: Flock and Sleep

2003-08-14 Thread Oliver Schnarchendorf
On Fri, 8 Aug 2003 02:32:05 +0500, Sara wrote: > open(NUMBER,">>data.txt"); > flock (NUMBER, 2); > close (NUMBER); > closing a file automatically removes the lock?? The answer is yes. When you close files they will automatically un-locked. One thing though, you might want to use the fcntl module

Re: Flock and Sleep

2003-08-06 Thread Bob Showalter
Sara wrote: > (sub get_number { > open(NUMBER,">>data.txt"); > flock (NUMBER, 2); Use the constants from the Fcntl module. > > Do blah blah blah > > close (NUMBER); > > closing a file automatically removes the lock?? Yes. > or should I have to > unlock it by placing > > flock (NUMBER, 8); > clo