Skip to content

Improve XDG Base Directory Specification implementation#1609

Merged
obiltschnig merged 1 commit intopocoproject:developfrom
rudolfwalter:develop
Feb 23, 2017
Merged

Improve XDG Base Directory Specification implementation#1609
obiltschnig merged 1 commit intopocoproject:developfrom
rudolfwalter:develop

Conversation

@rudolfwalter
Copy link
Copy Markdown
Contributor

This builds upon #561 .


The XDG Base Directory Specification requires that the end user can specify a custom location for their config, data, and cache directories, simply by changing the values of three environment variables (XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_CACHE_HOME). In case any of those is unset or empty, its default should be used.

#561 implements the spec only partially: it always returns the default values (~/.config, ~/.local/share, ~/.cache), regardless of the values of the aforementioned environment variables.

This PR implements the missing functionality.


Furthermore, #561 added the concept of a userwide temporary directory. This concept does not exist in the XDG Base Dir Spec. I have personally never seen such a thing on any of the unix systems I have used either. If the application wants a real temp dir, it should use /tmp, which is automatically cleared on reboot. Otherwise it should use the cache dir (or, if it really wants system-wide persistent temp, it may use /var/tmp).

#561 defined this userwide temp to be ~/.local/tmp on unixes (and equal to the normal temp on other systems), but I find this to be a bad idea, because on the one hand it is not standard, and on the other hand, it is not automatically cleared, and thus would become a place that slowly fills up the disk with garbage (for those semantics, use the cache dir instead).

Based on this reasoning, this PR removes the Poco::Path::tempHome() function and its implementation.

@obiltschnig obiltschnig merged commit 7e4c84e into pocoproject:develop Feb 23, 2017
@obiltschnig obiltschnig added this to the Release 1.8.0 milestone Feb 23, 2017
@aleks-f aleks-f modified the milestones: Release 1.8.0, Release 1.8.2 Feb 13, 2018
@obiltschnig obiltschnig added this to the Release 1.10.0 milestone Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants