I want to use flock more often in my programming. I have thought that it would be nice to try to flock the file more than once. Because if i use flock(FH,1) or die.. then i'm afraid it will cause the program to error when it simply can't get the lock on the first try.
so I've been trying to think of control structures to allow for 10 trys, or more. I'm not sure I know a good number of times to loop back over, because all of this could happen in a fraction of a milisecond, and I will have tried to flock the file 1000 times and it still won't work.
now I'm also very ignorant when it comes to this, and I've heard that flock will try continously until it gets the lock, (if the file is already locked)... is this true.. how could I go about doing this?
Thanks monks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.