Page 1 of 1

local storage for plugins

Posted: Fri Feb 27, 2015 10:42 pm
by sejtam
I want to develop a plugin which detects changes in (some) of a command's output.

For this of course the plugin needs to remember the previous (one or more) results.

Is there a convention where a plugin should store such info?

Re: local storage for plugins

Posted: Sun Mar 01, 2015 6:57 pm
by Box293
A lot of plugins use files in /tmp/

However for those operating systems that dump /tmp/ on a reboot, /var/tmp/ is a better location.

It all depends on how easy or complicated you want to make things.

Re: local storage for plugins

Posted: Sun Mar 01, 2015 11:20 pm
by sejtam
Ok. I had played with the thought of using /var/spool or such...
/var/tmp is really for temp files, which are not intended to survive across
calls to the same program, so I consider that less of an option...

Re: local storage for plugins

Posted: Mon Mar 02, 2015 10:09 am
by jdalrymple
Certainly a matter of not only your preference but the reason for the output. If it is simply to measure a rate of change then /tmp should be fine as it will only take 1 iteration of the check to rebase the local storage location. In situations where you're watching for changes that should never occur though you are right, a custom location under var would be more appropriate. There are no documented best practices, feel free to choose the location that suits you and your application best.