in reply to Locking a script
in pseudo-perl, this would be:
if ( lockfile_exists() ) { warn script_is_locked(); exit 1; } $SIG{'__DIE__'} = \&remove_lockfile(); lock_file(); do_stuff(); remove_lockfile(); exit;
just be sure to install your signal handler(s) after you test for file locking... race conditions really suck.
dirty...
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Re: Locking a script
by merlyn (Sage) on Oct 19, 2000 at 08:42 UTC | |
by AgentM (Curate) on Oct 19, 2000 at 08:53 UTC | |
by merlyn (Sage) on Oct 19, 2000 at 08:56 UTC |