in reply to Re: IO::Zlib and flock
in thread IO::Zlib and flock

To perform a stronger locking scheme, just rename the file to something else during your operation.

And exactly how is this stronger? You'll just end up snatching the file from some other application that may be reading/writing from/to it.

--perlplexer

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

    File locking doesn't change what another application can or cannot do. Remember the caveats I mentioned. Renaming the file to something else will block another application from subsequently manipulating the file once you've begun your operation.

    Don't think of file locking as "protect myself from the other application's meddling," but rather as "notify other applications of my meddling." If you want to protect your app from others, don't give the other app an opportunity to meddle at all.

    --
    [ e d @ h a l l e y . c c ]