Re: [lazarus] avoiding multi-instance detection

2006-10-03 Thread Onjahyr
solution in Linux? how sintaxe used? :) Alexsander Rosa escreveu: > The /var/run solution is almost canonic for Linux. > But how to do this in a multi-platform way? > > 2006/10/3, Ales Katona <[EMAIL PROTECTED]>: >> /var/run with pids is also present in FreeBSD 5.x+ >> >> But it's just a dumpspa

Re: [lazarus] avoiding multi-instance detection

2006-10-03 Thread Alexsander Rosa
The /var/run solution is almost canonic for Linux. But how to do this in a multi-platform way? 2006/10/3, Ales Katona <[EMAIL PROTECTED]>: /var/run with pids is also present in FreeBSD 5.x+ But it's just a dumpspace for these things.. It still doesn't add anything useful :) I think there's som

Re: [lazarus] avoiding multi-instance detection

2006-10-03 Thread Ales Katona
/var/run with pids is also present in FreeBSD 5.x+ But it's just a dumpspace for these things.. It still doesn't add anything useful :) I think there's some syscall to do what "ps" does basicly. Might be worth looking at, that way you won't depend on external crap. Ales > At least FreeBSD 4 has

Re: [lazarus] avoiding multi-instance detection

2006-10-02 Thread Marc Santhoff
Am Montag, den 02.10.2006, 17:51 +0200 schrieb Ales Katona: > FreeBSD might or might not have /proc mounted. Default is no however, so > you can't be sure. > > However you can still save the pid # of the process in some file, then > when starting a new one, read this number, check output of ps (or

Re: [lazarus] avoiding multi-instance detection

2006-10-02 Thread Ales Katona
FreeBSD might or might not have /proc mounted. Default is no however, so you can't be sure. However you can still save the pid # of the process in some file, then when starting a new one, read this number, check output of ps (or use syscalls if applicable) for given number and if "pos" finds the n

Re: [lazarus] avoiding multi-instance detection

2006-10-02 Thread Burkhard Carstens
Am Montag, 2. Oktober 2006 16:13 schrieb Al Boldi: > Burkhard Carstens wrote: > > Am Donnerstag, 28. September 2006 22:41 schrieb John vd Waeter: > > > Problem when program crashes. File is not deleted. Maybe refresh > > > file every 5 minutes or so, put a timestamp in it. If timestamp > > > older

Re: [lazarus] avoiding multi-instance detection

2006-10-02 Thread Al Boldi
Burkhard Carstens wrote: > Am Donnerstag, 28. September 2006 22:41 schrieb John vd Waeter: > > Problem when program crashes. File is not deleted. Maybe refresh file > > every 5 minutes or so, put a timestamp in it. If timestamp older then > > 5 minutes, program appearantly crashed, new instance may

Re: [lazarus] avoiding multi-instance detection

2006-09-29 Thread Alejandro Lucas Baldres
Thanks for your help!-- Lucas BaldrésUsuario linux #: 425616Maquina #: 333252

Re: [lazarus] avoiding multi-instance detection

2006-09-29 Thread Burkhard Carstens
Am Donnerstag, 28. September 2006 22:41 schrieb John vd Waeter: > Problem when program crashes. File is not deleted. Maybe refresh file > every 5 minutes or so, put a timestamp in it. If timestamp older then > 5 minutes, program appearantly crashed, new instance may start. > > John Put you PID in

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Alexandre Leclerc
2006/9/28, A.J. Venter <[EMAIL PROTECTED]>: Just a simple question: would that be possible to simply query the > list of actual processes that are running? 'ps ax' for example; then > you can find your application? Yep, you could do this with a TProcess - however, having said that - as I said bef

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread A.J. Venter
Just a simple question: would that be possible to simply query the list of actual processes that are running? 'ps ax' for example; then you can find your application? Yep, you could do this with a TProcess - however, having said that - as I said before when this same question was discussed - the

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Alexandre Leclerc
2006/9/28, Bogusław Brandys <[EMAIL PROTECTED]>: Graeme Geldenhuys wrote: Well.The main problem with linux in this particular case is that it's hard to find such global resource which is: - atomic (no other process can get it in the same time like file lock or system-wide mutex) - automatically r

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Graeme Geldenhuys
On 28/09/06, Bogusław Brandys <[EMAIL PROTECTED]> wrote: According to pthreads docs: "Mutexes can be applied only to threads in a single process and do not work between processes as do semaphores." Maybe semaphores are right solution ? Could this help? It is global to processes, and not just

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys
Graeme Geldenhuys wrote: On 28/09/06, John vd Waeter <[EMAIL PROTECTED]> wrote: Problem when program crashes. File is not deleted. Maybe refresh file every 5 minutes or so, put a timestamp in it. If timestamp older then 5 minutes, program appearantly crashed, new instance may start. John Sim

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Marc Weustink
Graeme Geldenhuys wrote: > On 28/09/06, John vd Waeter <[EMAIL PROTECTED]> wrote: >> Problem when program crashes. File is not deleted. Maybe refresh file >> every 5 minutes or so, put a timestamp in it. If timestamp older then 5 >> minutes, program appearantly crashed, new instance may start. >> >

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys
Graeme Geldenhuys wrote: On 28/09/06, John vd Waeter <[EMAIL PROTECTED]> wrote: Problem when program crashes. File is not deleted. Maybe refresh file every 5 minutes or so, put a timestamp in it. If timestamp older then 5 minutes, program appearantly crashed, new instance may start. John Sim

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Graeme Geldenhuys
On 28/09/06, John vd Waeter <[EMAIL PROTECTED]> wrote: Problem when program crashes. File is not deleted. Maybe refresh file every 5 minutes or so, put a timestamp in it. If timestamp older then 5 minutes, program appearantly crashed, new instance may start. John Simple solution, program with

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread John vd Waeter
Problem when program crashes. File is not deleted. Maybe refresh file every 5 minutes or so, put a timestamp in it. If timestamp older then 5 minutes, program appearantly crashed, new instance may start. John Bogusław Brandys wrote: Alejandro Lucas Baldres wrote: My plataform i386 with Linu

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys
ik wrote: Another way, that is easier to control, is to use mutexes. Mutex is a place in memory that is locked until someone free it. So you can check if that place (usually mapped to a name, alto I do not remember at the moment how Linux implement it) exists, and if so, you stop your own executi

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread ik
Another way, that is easier to control, is to use mutexes. Mutex is a place in memory that is locked until someone free it. So you can check if that place (usually mapped to a name, alto I do not remember at the moment how Linux implement it) exists, and if so, you stop your own execution, otherwi

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys
Alejandro Lucas Baldres wrote: My plataform i386 with Linux (ubuntu dapper 6.06), the future of program is free and opensource. I want the program disallow more then one instance. The simplest solution: let program check if /tmp/ file exists and create it,then on exit delete.If file exists th

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Alejandro Lucas Baldres
My plataform i386 with Linux (ubuntu dapper 6.06), the future of program is free and opensource.I want the program disallow more then one instance.2006/9/28, Bogusław Brandys < [EMAIL PROTECTED]>:Alejandro Lucas Baldres wrote: > Hello, I'm buy a program, this no can allow more of a instance. ¿How t

Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys
Alejandro Lucas Baldres wrote: Hello, I'm buy a program, this no can allow more of a instance. ¿How to for no allow more of one instance? Thank you and sorry for my bad english -- Lucas Baldrés Usuario linux #: 425616 Maquina #: 333252 Try to describe in simpler words :) Which platform ? Lin

[lazarus] avoiding multi-instance detection

2006-09-28 Thread Alejandro Lucas Baldres
Hello, I'm buy a program, this no can allow more of a instance. ¿How to for no allow more of one instance?Thank you and sorry for my bad english-- Lucas BaldrésUsuario linux #: 425616 Maquina #: 333252