How to find whether our application is already running


Ad

Advertisements

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.
 
Ad

Advertisements


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

Top