On Sat, 28 Apr 2012 22:46:02 +0300
"Ville M. Vainio" <[email protected]> wrote:
> Typically, you should store process id of the leo process keeping the
> file open in g.app.db. That way, if you see that the file is reported
> to be open by a process that no longer exists, you know it's stale
> data.
>
> (e.g.
>
> {
> "workbook.leo" : [1222, 2323]
> }
But how can you tell the process no longer exists? What if the
pid is now in use by a different process? Seems likely to happen
if you're opening Leo about the say point in your system startup
each time. Might not be the exact same pid, but it could be
getting a pid in a range which is likely to be in use. Seems to me you
want to check the command line for the given pid, and I can't see a pure
python way to do that.
There's a module out there called psutil, but apart from being another
dependency we'd have to ship, it uses .c, so isn't pure python.
Cheers -Terry
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.