Peter, you could also use shell() to parse the output of the ps
command to check if your application is already running, and then exit
a  2nd instance if one is found to be in the running processes.

Bernard

On Sat, May 23, 2009 at 1:04 PM, Jan Schenkel <janschen...@yahoo.com> wrote:

> I'm sure some Unix zealots might come and whack your fingers off if you try 
> and take that behaviour away from them ;-)
>
> Seriously, there's no built-in way to prevent it; but you can always employ a 
> crude locking mechanism by writing a myapp.lk file somewhere, and refusing to 
> open the application when that file is already present.
> Or you can open a server socket on a fixed port, and quit if you fail to grab 
> that port; the added advantage of the socket approach being that you can use 
> the server socket to receive an 'open file' message from the second started 
> instance.
>
> Jan Schenkel
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to