in reply to Perl/Tk question about starting programs via a button
One method would be to create an app-specific lockfile before starting an app and not start the app again until the lockfile was removed. The app has to delete the lockfile on finish. Disadvantage: If the app crashes without deleting the file the app is blocked
A better method would remember the process id of the app and check if it still exists before starting it again.
And if you want to be 100% sure you could use interprocess communication to ask the app if it still exists. But that would be overkill in most situations
|
|---|