Description
Currently, XDG uses the same behavior for macOS and other Unix-like operating system. However, if one refers to the Apple Guidelines on directories organization, this should not be the case.
Xdg provides (I excluded home and runtime dir which are not important here):
XDG_DATA_HOME
(asdata_dir
) ->~/.local/share
XDG_CONFIG_HOME
(asconfig_dir
) ->~/.config
XDG_CACHE_HOME
(ascache_dir
) ->~/.cache
XDG_STATE_HOME
(asstate_dir
) ->~/.local/state
The macOS hierarchy is quite different and in fact, it is closer to the behavior that is currently implemented for Windows. As far as I understand the XDG standard and the Apple Documentation, we should have:
XDG_DATA_HOME
(asdata_dir
) ->~/Library/Application Support
(W: LocalAppData)XDG_CONFIG_HOME
(asconfig_dir
) ->~/Library/Application Support
(W: LocalAppData)XDG_CACHE_HOME
(ascache_dir
) ->~/Library/Application Support
(W: LocalAppData)XDG_STATE_HOME
(asstate_dir
) ->~/Library/Caches
(W: InternetCache)
The main problem is that fixing this would basically break packages that use XDG. On the other side, it would improve compatibility with macOS tools (for example, automatic backups on macOS ignore ~/Library/Caches
). Also, I am wondering what is the best way to detect that we use macOS.