Expand description
The user’s folders: XDG’s on Linux, the profile’s on Windows. An app keeps its files in a folder of its own under one of these, named after itself.
| Function | Linux | Windows |
|---|---|---|
home | HOME | USERPROFILE |
data_home | XDG_DATA_HOME, else ~/.local/share | APPDATA, roaming with the user |
config_home | XDG_CONFIG_HOME, else ~/.config | APPDATA |
cache_home | XDG_CACHE_HOME, else ~/.cache | LOCALAPPDATA, kept on this machine |
state_home | XDG_STATE_HOME, else ~/.local/state | LOCALAPPDATA |
An XDG_* variable that is set wins on Windows too. Each is None when neither the variable nor what it falls back to is set.
Functions§
- Where what can be rebuilt goes, such as downloaded pages or thumbnails.
- Where the user’s settings go.
- Where the user’s own data goes, such as bookmarks or history.
- The user’s home folder:
HOME, or on Windows, where it is seldom set,USERPROFILE. - Where state that should outlive a run but not follow the user goes, such as logs or a window’s last place.