in reply to RE: Re: flock question in thread flock question
That's probably the simplest way around it - however when coding I tend to try to minimise the number of "things" that the script has to deal with. In this particular case a number of other files were being used but only one needed the lock and so it seemed logical to keep the lock with the file rather than create another object for the script to manipulate. Perhaps a good idea would be to come up with a generalised set of lock/unlock subroutines that I could use in all my scripts - I'll post it in snippets when I get it written.
|