At 01:57 +0100 2002.01.10, Bart Lateur wrote:
>I just wish that flock() wouldn't case a fatal error on these platforms
>(Mac/Win). Now you have to work your way around it. Something like:
>
> use Fcntl ':flock';
> use constant HASFLOCK => eval { flock STDOUT, LOCK_UN; 1 } || 0;
> print HASFLOCK;
>
>and use:
>
> flock FILE, LOCK_EX if HASFLOCK;
Well, this, the prescribed method, should be reliable:
use Config;
flock FILE, LOCK_EX if $Config{d_flock};
If that is not reliable, the perl is configured improperly. I've gone
through significant length to make sure Config.pm has as many correct
values as possible in MacPerl 5.6.1 (d_flock is properly undefined in
5.2.0r4 too).
--
Chris Nandor [EMAIL PROTECTED] http://pudge.net/
Open Source Development Network [EMAIL PROTECTED] http://osdn.com/