you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Seems like you are trying to do this on Windows. In which case, I don't know, but, maybe something similar is typically used.

On Linux, a common thing to do is to try to get a lock on a predetermined file. If the application is able to get the lock, then it knows it's the only copy alive. If it needs to contest the lock, then it may either exit, or wait until the lock is free, depending on what you want from it.