Hi Deri,

Programs should not create arbitrary directories in $HOME. That was
commonplace 20 or 30 years ago, but is frowned upon nowadays.

The location of such a directory depends on its lifetime and contents:

* If its lifetime is shorter than the process duration, that is, if
  it is no longer relevant once the process terminated, it should be
  under $TMPDIR, not under $HOME. If TMPDIR is not set, use /tmp
  instead of $TMPDIR.

* Otherwise:

  - If it contains configuration that the user should be able to
    modify (either via a text editor or via an appropriate program),
    it should be $HOME/.config/<program>/ (or $XDG_CONFIG_HOME/<program>/
    if that environment variable is set [1]).

  - If it contains data that may be deleted and is persisted only to
    provide a speedup, it should be $HOME/.cache/<program>/
    (or $XDG_CACHE_HOME/<program>/ if that environment variable is set [1]).

  - If it contains other data, that is neither configuration nor
    deletable (for example, log files, user spell-check customizations,
    and many more), it should be $HOME/.local/share/<program>/
    (or $XDG_DATA_HOME/<program>/ if thet environment variable is set [1]).

The purpose of this specification [1] is that users
  - have an easy way of erasing all caches,
  - can have all their user data on an USB stick, needing to set only 3 or 4
    environment variables.

That's the de-facto standard nowadays.

Bruno

[1] https://specifications.freedesktop.org/basedir/latest/




  • Re: groff 1.24.0.r... Bruno Haible via GNU roff typesetting system discussion
  • Re: groff 1.24.0.r... Bruno Haible via GNU roff typesetting system discussion
  • Re: groff 1.24.0.r... Bruno Haible via GNU roff typesetting system discussion
    • Re: groff 1.2... G. Branden Robinson
      • Re: groff... Deri via GNU roff typesetting system discussion
        • Re: g... G. Branden Robinson
          • R... Deri via GNU roff typesetting system discussion
            • ... G. Branden Robinson
        • Re: g... Bruno Haible via GNU roff typesetting system discussion
          • R... Deri via GNU roff typesetting system discussion
            • ... Bruno Haible via GNU roff typesetting system discussion
              • ... Deri via GNU roff typesetting system discussion
              • ... Bruno Haible via GNU roff typesetting system discussion
              • ... G. Branden Robinson
              • ... Bruno Haible via GNU roff typesetting system discussion
              • ... Deri via GNU roff typesetting system discussion
  • Re: groff 1.24.0.r... Bruno Haible via GNU roff typesetting system discussion
  • Re: groff 1.24.0.r... Bruno Haible via GNU roff typesetting system discussion

Reply via email to