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...
In reply to Re: Locking a script
by d_i_r_t_y
in thread Locking a script
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |