For Linux, here is the spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html
macOS has the NSSearchPathForDirectoriesInDomains API.
For Windows, there’s also an API for that, but I don’t know it offhand.
For Linux, here is the spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html
macOS has the NSSearchPathForDirectoriesInDomains API.
For Windows, there’s also an API for that, but I don’t know it offhand.