trbs / pid

Pidfile featuring stale detection and file-locking, can also be used as context-manager or decorator
https://pypi.python.org/pypi/pid/
Apache License 2.0
102 stars 26 forks source link

Pidfile location on Windows #33

Closed rbscholtus closed 4 years ago

rbscholtus commented 4 years ago

Hi! Thanks for the awesome library, I think it's the best pidfile manager around.

I have some doubt about one thing though, on Windows the pdifile is simply stored in the temp folder. Doesn't that make it susceptible to being deleted by some cleanup process? I like the idea of storing the pidfile in a user folder first (similar to /var/user/%s), so I was just wondering if %APPDATA% would be the sensible first location to try, perhaps followed by ~\AppData\Roaming if APPDATA not exists, and finally fall back to tempdir? (inspired by confuse)

Happy to try to code it up (would be my first Github contrib), although I'm pretty sure you know what you are doing.

rbscholtus commented 4 years ago

Created PR. I hope it is useful to you.

trbs commented 4 years ago

Thanks !

Honestly I have no experience on Windows so it's hard for me to really tell, but it makes sense to do it in a similar manner.

And if there are others, people can always contribute suggestions in additional PR's :-)

trbs commented 4 years ago

https://pypi.org/project/pid/3.0.4/