I want to prevent users from starting a 2nd copy of a root program (root 5.24 compiled C++ program under linux).
Ideally, if a 2nd copy is started, it should just bring the running copy’s window to the front of the display, and then terminate. If it just informed the user and terminated, that would be fine.
Is there a good way to do this with some root functions?
(One way has been pointed out to me, but I’m hoping for something simpler. The suggestion is, at start up time, to have a thread open and listen on a socket. If the socket is already opened, it means a program copy is already running, so send a message to that socket, then terminate. If it receives a message on this socket, bring the program’s window to the front of the display.)
Is there a way I can find the executing program’s name at run time?
This would let me generalize the code. (at compile time, I maybe do not know what the program name will be at run time).
I see that GetFromPipe() is in 5.24, and we are on 5.22, but I could just pull the source snippet from 5.24.
My mistake on saying we were 5.24 in the original post.
Multiple systems, multiple versions.
Regarding different root versions -
If we have different versions communicating with TSockets and Tmonitor, should we use EnableSchemaEvolutionForAll(), as in the hclient tutorial?
And we also have windows and linux systems with different root versions.
[quote]If we have different versions communicating with TSockets and Tmonitor, should we use EnableSchemaEvolutionForAll(), as in the hclient tutorial?
And we also have windows and linux systems with different root versions. [/quote]If you are not 100% guaranteed to have the same revision of ROOT on both end, yes you should enable the schema evolution support.