in reply to Order of flock and open

you can also try something:
use Fcntl; open FILE, $file, O_EXLOCK or die "Cannot open or lock $file. $!\n";
to lock the file exactly when you open it

Antonis!

Replies are listed 'Best First'.
Re: Re: Order of flock and open
by Aragorn (Curate) on Apr 30, 2003 at 19:31 UTC
    I'm wondering on what OS you're using that. It fails for me on both Linux and FreeBSD.

    Arjen