Hi, thanks to your inputs I'm mostly through with a rework of the File::FnctlLock module. It's now basically three modules:
a) File::FcntlLock (or File::FcntlLock::XS as an alias) - this is basically the old module, using XS, b) File::FcntlLock::Pure - created during Perl "Makefile.PL" where a C program is run to add the necessary Perl code for packing/unpacking the C flock struct, c) File::FcntlLock::Inline - similar to File::FcntlLock::Pure in that it uses pack/unpack but creates, compiles and runs a C program for determining the binry layout of the flock structure each time it's loaded. There's a rather minor difference between the functionality of the first and the two others: File::FcntlLock also accepts a file descriptor as an argument to the lock() method call, while the other to only can deal with file handles or type- globs. The handling of errors (when passing invalid arguments to the lock() method) also deviates slightly: File::FcntlLock passes them on to the fcntl(2) system call while for the others Perl's fcntl() function rejects some of them. You can simply pick the one you would like to use or, if there are concerns that one of them won't work, do a 'use' in an eval and switch to another one if loading fails. I've also played around with the idea of switching to a different one automati- cally but this got rather tricky with the MakeMaker build system (I don't think it was written with the idea in mind that there could be a submodule that is XS-based) and then the little dif- ferences in behaviour made me decide against it - other people using the module might be caught unaware when, for whatever reasons, the XS-version doesn't work but this isn't obvious and then suddenly an attempt to lock() on a file descriptor suddenly fails. Someone having to figure out what's going wrong in such a situation probably wouldn't be too amused;-) Could you be so kind and give the thing a try and tell me if you notice any irregularities? I append the tar ball. Thank you and best regards, Jens -- \ Jens Thoms Toerring ________ j...@toerring.de \_______________________________ http://toerring.de
File-FcntlLock-0.15.tar.gz
Description: Binary data