Every example I've seen for flock locks the file after opening it. While I understand you need to open the file to get the filehandle, this seems risky to me. What if another request sneaks in between the open and flock commands? Ditto for unlocking and closing the handle.
Am I just being overly paranoid? Are there safeguards built into Perl to prevent something from happening to the file between the open and flock commands?
Thank you.
In reply to Order of flock and open by svsingh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |