Hi,

If you are going to run your program on Linux/Unix, you can use DBus
and it's feature to assign unique name to connected client; example
of this you can find at:

http://sundaram.wordpress.com/2010/01/08/single-instance-apps-using-d-bus/

However, if you are thinking to make it OS inferior or simply to omit
DBus, you can create hidden so called 'lock' file at known location
when application starts (e.g. /tmp/.foo.lock) and delete it when
application quits; the same application will check if that file exists
and if does, report how one instance is already running.

Sanel

On Sat, Feb 16, 2013 at 05:10:11AM -0800, Gonzalo Garramuno wrote:
> I would like my application to have only one instance of it running at a 
> time.  However I am unsure how to implement this.
> If the user opens another instance the contents of what it opened should go 
> to the already opened instance.
> As an example, I would put emacs.
> 
> How would I go about coding this?  Pipes?  Sockets?  None of the above.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to