in reply to IO::Zlib and flock

From Zlib.pm
# in new() croak "open() needs a filename" unless defined($filename); $self->{'file'} = gzopen($filename,$mode);
So, it's passing $filename from new() directly to gzopen() in Compress::Zlib. According to the docs, gzopen() accepts either a file name or an open file handle, in which case it'll call gzdopen(). So, the solution to your problem may be to open() the file first, lock it, and then pass this locked file handle to new().
I haven't tried it though, so you'll need to test it to make sure it works.

--perlplexer

Replies are listed 'Best First'.
Re: Re: IO::Zlib and flock
by hardburn (Abbot) on May 21, 2003 at 17:28 UTC

    That worked. Thanks.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    Note: All code is untested, unless otherwise stated