Return the cache directory for the current platform or XDG_CACHE_HOME if specified.
Like Path::components(), but produces an extra empty component at the end
when path contains a trailing slash.
Return the config directory for the current platform or XDG_CONFIG_HOME if specified.
Return the data directory for the current platform or XDG_DATA_HOME if specified.
Expand tilde (“~”) into a home directory if it is the first path component
true if the path has a trailing slash, including if it’s the root directory.
Strip any trailing slashes from a non-root path. This is required in some contexts, for example
for the PWD environment variable.