in reply to [Solved]Easiest way to protect process from duplication.
Note that depending on your OS and how you call the program, a second open may fail (and then, the flock isn't necessary).use Fcntl ':flock'; open my $fh, "+<", $0 or exit; exit unless flock $0, LOCK_EX | LOCK_NB;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Easiest way to protect process from duplication.
by gnosti (Chaplain) on Jan 23, 2012 at 05:52 UTC | |
by JavaFan (Canon) on Jan 23, 2012 at 07:47 UTC | |
by kazak (Beadle) on Jan 24, 2012 at 13:38 UTC | |
by kazak (Beadle) on Jan 24, 2012 at 13:29 UTC | |
Re^2: Easiest way to protect process from duplication.
by kazak (Beadle) on Jan 21, 2012 at 06:16 UTC | |
by JavaFan (Canon) on Jan 21, 2012 at 08:38 UTC |
In Section
Seekers of Perl Wisdom