How to find whether our application is already running

M

Maxim Yegorushkin

Pascal said:
Another way would be to use dbus, or any other kind of registry that
will safely relinquish the unique name upon exit of your process.

A portable way is to use file locking (although the APIs are different for
Windoze/POSIX). An application starts, creates a file with the same pathname and
then tries to lock it. If locking succeeds this is the first instance of
application. When the application terminates for any reason the operating system
releases the file lock.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top