[Interest] Detecting if the application is already running from another user account
Jérôme Godbout
jerome at bodycad.com
Fri Jun 3 15:19:48 CEST 2016
What about a pid file, check if process still alive, no matter the user
that should work.
On Fri, Jun 3, 2016 at 9:14 AM, Nye <kshegunov at gmail.com> wrote:
> Hello,
> Yes, you are correct, I forgot all about that although I was thinking more
> of a platform-specific solution. Also the class is somewhat inconvenient as
> the behaviour is a bit different on Windows and *nix.
>
> You could try some platform-specific code handling it (e.g. Windows does
> allow for global mutexes to be created through the win API), or using
> advisory file locking, which would be my choice.
> Also opening a local server socket the first time the application is
> started could be used to deduce whether the process is running if that
> suits you better.
>
> Perhaps QLockFile is a better option (http://doc.qt.io/qt-5/qlockfile.html)
> in this case?
>
> Kind regards.
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160603/b789de82/attachment.html>
More information about the Interest
mailing list