in reply to File Locking

If I did understood you well you remove the file from the command line while it is locked by the Perl script - and you are supprised that you can do that. It depends on the system you are using, but on some (if not on most of them) the flock call is a C library call - and thus it is just a advisory lock, not a mandatory one. So with shell you can allways go around it.

Replies are listed 'Best First'.
Re: Re: File Locking
by nimdokk (Vicar) on Apr 23, 2003 at 15:23 UTC
    OK, what if I have do an unlink on the file from another Perl program instead?
      Then that "another Perl program" first needs to check whether the file is locked or not, and unlink() or truncate() (if appropriate) it only if it's not locked.

      --perlplexer