in reply to •Re: Re: Order of flock and open
in thread Order of flock and open
Example:
In summary: please don't follow my original advice. Merlyn is probably right in the general case, and will probably even find a good explanation as to why I've fooled myself into believing what I do. I'll add a caveat to the particular portion of my brain which holds this information, but I'm unlikely to erase it completely :)% perl -MFcntl -e 'open my $f, "<foofile"; flock $f, LOCK_EX; open my +$g, ">foofile"; flock $g, LOCK_EX|LOCK_NB or die "No lock\n";' + No lock %
Alan
|
|---|