Hi All,
I've got a problem with a script running on a Linux 2.4 kernel where 'flock' is apparently broken. Therefore I'm thinking of using the 'fcntl' wrapper.
Here's the existing flock call:
So, I need to create an exclusive lock on an entire file (like flock does) and make it non-blocking. Can I do this with fcntl like this?
Are there any other modules/mthods I can use?
Thanks for any help on this.
rotis23
I've got a problem with a script running on a Linux 2.4 kernel where 'flock' is apparently broken. Therefore I'm thinking of using the 'fcntl' wrapper.
Here's the existing flock call:
Code:
$retval = flock(QF, $LOCK_EX|$LOCK_NB)
So, I need to create an exclusive lock on an entire file (like flock does) and make it non-blocking. Can I do this with fcntl like this?
Code:
my $lock = struct_flock(F_WRLCK,SEEK_SET,0,0,0);
...
fcntl(QF, F_SETLK, $lock) or die "F_GETLK $$ @_: $!";
...
Are there any other modules/mthods I can use?
Thanks for any help on this.
rotis23