XDG_DATA_HOME vs XDG_STATE_HOME usage

Josef Šimánek josef.simanek at gmail.com
Mon Sep 12 23:22:32 UTC 2022


út 13. 9. 2022 v 0:40 odesílatel Thiago Macieira <thiago at kde.org> napsal:
>
> On Monday, 12 September 2022 15:26:49 PDT Josef Šimánek wrote:
> > Anyway, is that the decision maker for XDG_DATA_HOME vs
> > XDG_STATE_HOME? Synced vs not synced between machines?
>
> No. It should be about the nature of the data.
>
> https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html says
> "state data that should persist between (application) restarts, but that is
> not important or portable enough to the user that ..."
>
> That is to say, if those files were lost, it wouldn't be the end of the world.
> The user may perceive some changes, but not anything that they themselves
> created.
>
> That's again different from cache, which are files that should be periodically
> cleaned up. In my own system, I don't back up cache dirs, but I do back up
> state ones.

XDG_CACHE_HOME wasn't even considered from our side. Currently I'm
trying to find out the difference between XDG_DATA_HOME and
XDG_STATE_HOME for the mentioned usecase.

Would you recommend XDG_STATE_HOME then? It seems it fits the best.
Sync across machines for this file really depends on user preference.
Sometimes it makes sense, sometimes not.

> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>    Software Architect - Intel DCAI Cloud Engineering
>
>
>


More information about the xdg mailing list