[Gambas-user] How to avoid second instance?

Eilert eilert-sprachen at ...221...
Wed Sep 15 15:37:28 CEST 2004


Hi Alberto,

Uff! :-) Wow...

Thanks for that tip, I'll try it as soon as I find some time.

By the way, is there a "if exist directory X" thing? Or would you do it 
with dir$?

Rolf


Alberto Torres schrieb:
> Maybe using a lock file with the PID in it:
> 
> -Check if exists the lock file (say /tmp/yourapp.lock) and it has a 
> number in it.
>    -If so, check if the program with that PID is running (i.e. checking 
> /proc/[pid], say pid is 12345, check if directory /proc/12345 exists)
>       -If it is already running, exit
>       -Else, replace the lock file writng Application.Id in it, and 
> continue.
> 
> Regards
> DiThi
> 
> Eilert escribió:
> 
>> Hi,
>>
>> how can I avoid that a second instance of the same prog is started e. 
>> g. by a double click?
>>
>> Is there a way of finding out if there is another instance of the same 
>> prog by the same user running? Or do you think a file-based solution 
>> (lock files) is easier to implement?
>>
>> Rolf
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
>> Project Admins to receive an Apple iPod Mini FREE for your judgement on
>> who ports your project to Linux PPC the best. Sponsored by IBM. 
>> Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
> Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
> Camcorder. More prizes in the weekly Lunch Hour Challenge.
> Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 





More information about the User mailing list