[Gambas-devel] gb.desktop detect a running application

Jussi Lahtinen jussi.lahtinen at ...176...
Wed Aug 29 17:19:43 CEST 2012


I was thinking what is the real usage for this feature.
If you want to limit access for some data to one instance at time,
then this is not good way to do it (instead lock with id of opener should
be used).

And if you just want to prevent accidental multiple instances of your
program,
then I would guess the suggested code would do most of the job.
Anyway, there is no way to know whether you have started some program in
remote computer in some of the various ways.

Jussi




On 28 August 2012 02:06, Benoît Minisini <gambas at ...1...>wrote:

> Le 27/08/2012 17:51, Jussi Lahtinen a écrit :
> >
> >     Not at all.
> >
> >     A X11 desktop is a server whose applications do not necessarily come
> >     from the same client.
> >
> >     So to detect that an application is already running is tricky: two
> >     processes from the same executable on the same machine can run on two
> >     different desktops, how could you know that?
> >
> >     I think that an X11 application can register some properties on the
> root
> >     windows so that it knows that it already runs on that desktop. I
> think
> >     it may be a standard, but I don't go deeper than that at the moment.
> >
> >     Otherwise, this split between the desktop (X11) and the systems that
> run
> >     the application seems to be dumped with D-Bus and Wayland, so let's
> see!
> >
> >
> >
> > Maybe I missed something or I don't know enough about X11,
> > but doesn't pgrep list all processes no matter who started them and from
> > where?
> >
> > If I'm wrong, is there way I could demonstrate this problem?
> >
> >
> > Jussi
> >
>
> pgrep will give you the processes on one X11 client, not all processes
> running on the X11 server, which may not be the same computer!
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-devel mailing list
> Gambas-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20120829/6ad2011a/attachment.html>


More information about the Devel mailing list