in reply to Re: Determining if self is already running under WinNT/2000
in thread Determining if self is already running under WinNT/2000

If you are going to suggest lock files please do it right using sysopen to aviod race conitions as shown at Re: CGI Question - run external script and then update page and below. Typically you would print the PID to the lockfile:

use Fcntl qw(O_WRONLY O_CREAT O_EXCL); my $lockfile = '/tmp/lock'; if (sysopen(FH, $lockfile, O_WRONLY | O_CREAT | O_EXCL)) { # sysopen will only work if lockfile does not exist # do stuff close FH; unlink $lockfile or die "Can't unlink lockfile $lockfile $!"; } else { die "$lockfile exists so another instance of the script is running +!"; exit; }

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print