On 29/01/19 7:11 AM, songbird wrote:
DL Neil wrote:
On 29/01/19 1:29 AM, Karsten Hilbert wrote:
On Mon, Jan 28, 2019 at 07:02:47AM -0500, songbird wrote:

What about running a multi-tenant application (for multiple users who
are not also system-users) - cf them logging-on to run their own. It is
appropriate, possibly even "required" to keep Fred's config file,
reports, graphs, logs, etc; separate from Barney's. Ideally they will
not be sub-dirs of the application/package.

    if it is per user defined then $HOME/.config/<app-name>,
$HOME/.local/share/<app-name> and any temporary data can go
in $HOME/.cache/<app-name> will do it for posix on Windows
there is the per user app stuff which i haven't sorted out
yet.

    $HOME changes per user login name change.

        $HOME/.config/<app-name>/<app-user>/
        $HOME/.cache/<app-name>/<app-user>/


...The latter for tmp/intermediate files (without hassles, eg creating
unique fileNMs!). - and which can be wiped with a single command at the
end of the run!
...

   oh, well i don't need anything that complicated but
usually there is a way of generating unique file names
and managing temporary files.

=if the directory is dedicated to a user (and thus the files therein driven by his/her/their particular config file), then the issue of unique fileNMs no longer exists. Less complexity = more happiness (potential)...


   if you are running an application by a login user
which does not log out then eventually you may need
to use some other method of cleaning up the application's
files somehow but to me that is a whole different topic
from the issue of where to put them.

=(a) context managers

=(b) when the intermediate files (from an 'inherited system') are over-large (see also Backlog list!), this can become an issue.

Yes, it appears some way from the OP's intent (apologies to him, if appropriate).

However, K's comment encouraged a re-think:
- whilst re-developing the app into a multi-tenant possibility, using config files to separate the individuals/project teams/departments (back to the original question), my thought was that the intermediate files "belonged to" the app. Hence they were re-sited under (Linux) /tmp (considerations per above). - if the consideration of "separation" between the multiple 'tenants' is important (not in my case), then a generalised drop-zone, eg /tmp, is NOT acceptable, eg security/privacy. - hence the conclusion that any intermediate files should also be separated 'under' <app-user>, ie that they 'belong to' the user and NOT to the app! - this naturally leads to another convenience: unlike concerns for over-filling /tmp, there is no need to keep track of what has/not been created in $HOME/.cache/<app-name>/<app-user>/ because at the end of the run, all contents of the directory (incl/excl) can?should be deleted! (a context manager?)

Obvious when you think about it, but wasn't 'at the time'. Ideas appended to Project's Backlog...

Again, thanks!
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to