X
xhoster
from perldoc -f flock:
Note also that some versions of "flock" cannot lock things
over the network; you would need to use the more
system-specific "fcntl" for that. If you like you can force
Perl to ignore your system's flock(2) function, and so
provide its own fcntl(2)-based emulation, by passing the
switch "-Ud_flock" to the Configure program when you
configure perl.
Is there an easy way (a pragma or switch or something) to obtain the fcntl
based emulation *without* needing to recompile perl? Also, since flock
seems to be Perl's first choice over fcntl, I wonder why that is. What
disadvantages does building Perl with -Ud_flock have, other than this one:
Note that the fcntl(2) emulation of flock(3) requires that
FILEHANDLE be open with read intent to use LOCK_SH and
requires that it be open with write intent to use LOCK_EX.
Thanks,
Xho
Note also that some versions of "flock" cannot lock things
over the network; you would need to use the more
system-specific "fcntl" for that. If you like you can force
Perl to ignore your system's flock(2) function, and so
provide its own fcntl(2)-based emulation, by passing the
switch "-Ud_flock" to the Configure program when you
configure perl.
Is there an easy way (a pragma or switch or something) to obtain the fcntl
based emulation *without* needing to recompile perl? Also, since flock
seems to be Perl's first choice over fcntl, I wonder why that is. What
disadvantages does building Perl with -Ud_flock have, other than this one:
Note that the fcntl(2) emulation of flock(3) requires that
FILEHANDLE be open with read intent to use LOCK_SH and
requires that it be open with write intent to use LOCK_EX.
Thanks,
Xho