talking between programs
I was about to post this in the linux forum, but thought it might be better to go cross platform..
What is the best way to talk between programs? For example, suppose from the command line I launch two text editors.
In windows sometimes they will just revert back to the same instance. For example, if I run
and then shortly after
in windows this might sometimes just run one program, displaying two files. However, in linux most of the time (from my observation with many programs) they end up as two instances of enexpad.
What is the best cross-platform way to enforce single-instance programs? Not sockets.. is it?
Sockets are the only thing that's cross platform portable.
Pipes would be the other logical solution, but are highly platform specific.
Third option would be writing a lockfile somewhere, but that's a dirty and risky solution and therefore not recommended (what if the open client crashes and doesn't delete the lockfile while doing so...).