How about something like this:

Dim sOutput As String

Exec ["pgrep", "-f", "NameOfTheProgram.gambas"] Wait To sOutput

If Split(Trim$(sOutput), gb.NewLine).Count = 1 Then
Exec ["kill", sOutput]
Else
'Multiple instances found, do something else...
Endif

Jussi



On Fri, Oct 5, 2012 at 7:00 PM, Ru Vuott <[email protected]> wrote:

>
> > >
> > No, not really exceptional and in fact not really rare.
> >
> > There is no reason to think that one of your gambas projects
> > may have a
> > single instance running unless that is a particular
> > RULE.
>
> It seems to me the problem was: e.g. I have 3 running gambas program:
>
> a.gambas
> b.gambas
> c.gambas
>
> Their process name in (/proc/pid_num/comm) is same. But I can identify
> them via "/proc/pid_num/cmdline" and so identify easly the PID.
>
>
> BUT if the case is:
>
> a.gambas
> a.gambas
> a.gambas
>
> ....this is - in my opinion - another problem: difficult.
>
> bye
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Gambas-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to