[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
RFC: autodie behaviour with flock() ?
G'day p5p,
Quick sanity check. I'm adding flock() support to autodie, and I intend it
to have the following behaviour:
* When called with an invalid or unopened filehandle, autodying
flock will always produce an error. Otherwise:
* When called in blocking mode, autodying flock will throw an
exception on any failure.
* When called in non-blocking mode (with LOCK_NB), the error
value of flock() is not checked.
My reasoning here is that calling flock() in blocking mode means "I need
this lock", whereas calling it in non-blocking mode is a question: "Can I
get this lock right now?"
If you spot a problem with this plan, or have a better plan, please let me know.
Many thanks,
Paul
--
Paul Fenwick <pjf@perltraining.com.au> | http://perltraining.com.au/
Director of Training | Ph: +61 3 9354 6001
Perl Training Australia | Fax: +61 3 9354 2681
- Follow-Ups from:
-
Ben Morrow <ben@morrow.me.uk>
Zefram <zefram@fysh.org>
Paul Fenwick <pjf@perltraining.com.au>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]