in reply to Is the program there? (W32)

Searching through ps output is not really the right way to do it on Unix. It's time-consuming and error-prone--someone may create a link to the program with a different name or there may be two different programs with the same name.

Fortunately there's a simple solution that works on Unix and Windows:

#!perl -w use strict; use Fcntl qw(LOCK_EX LOCK_NB); my $lockfile = "/someabsolutepath/writeabledirectory/lockfile"; open LOCKFILE, ">", $lockfile or die "Cannot open lockfile\n"; if (!flock(LOCKFILE, LOCK_EX|LOCK_NB)) { print STDERR "Another copy of application is already running\n"; exit(0); }