[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: RE: Single instance only applications
From: "Glen Parker" <glenebob () nwlink ! com>
Date: 1999-07-29 21:06:28
[Download RAW message or body]
> Well, if you insist to use lock files, you can just write some text into
> the file so that such multi-instance programs can check and decide if
> they're allowed to run another instance exactly because another option is
> used. E.g., writing "screensaver" in the lock file, will allow kcmdisplay
> to spawn a new process if you attempt to run `kcmdisplay color` but not if
> you try to start `kcmdisplay screensaver`. But, once again, lock files
But really, this should be done in the file name, like:
kcmdisplay.$DISPLAY.<OPTION_ENCODING>.lock
And maybe write the pid into the file.
That way, a second instance would generate a file name, and if it already
exists, then exit, without having to worry about the contents (except for
error reporting maybe).
> are a poor solution: a) because user can change them (their name,
> delete them, or change their contents) b) and what you can do if you have
So? A user should be expected to live with the consequenses of modifying
files in /tmp. Besides, no ordinary user would do that anyway.
> `kcmdisplay screensaver` running and user tries to run `kcmdisplay` (with
> all tabs). Then you certainly want to have `kcmdisplay` running, but
> you'll have the screensaver functions duplicated (which is wrong, I
> agree).
--
Glen Parker
glenebob@nwlink.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic