3 ms·
> 12. Follow XDG-spec I'm so glad to see this included. I don't like $HOME being cluttered with .<app> config directories, but worse than that, far too many wh
by OJFord 8y ago
> 12. Follow XDG-spec
I'm so glad to see this included. I don't like $HOME being cluttered with .<app> config directories, but worse than that, far too many when releasing on macOS say Oh Library/Application\ Support/<app>/vom/something is the standard config location on Mac, so I'll respect XDG on Linux but on Mac it should go there. No! Such an unfriendly location for editable config files.
- dickeytk 8y agoI am having an impossible time verifying this, but I recall reading that MacOS deletes unaccessed files eventually from `~/Library/Caches/*`. Which would be a compelling reason to use that for cache. (Not being able to verify this I didn't add it to the article) If anyone can verify that I'm either right or wrong here that would be helpful.
- zbentley 8y agoOSX does not automatically delete from that directory. See: https://developer.apple.com/library/archive/documentation/General/Conceptual/MOSXAppProgrammingGuide/AppRuntime/AppRuntime.html https://developer.apple.com/library/archive/documentation/Ge... > Your app is responsible for cleaning out cache data files when they are no longer needed. The system does not delete files from this directory. However, many third-party tools delete from that directory with minimal caution if any, so it's a good idea to consider it ephemeral.
- dickeytk 8y agoappreciate the clarification!
- andreareina 8y agoI agree that seeing a bunch of ~/.<app> directories is annoying, but at the same time I do think that it makes sense for each application to manage its own hierarchy, rooted under e.g. ~/.apps/<app> instead of splitting it into ~/.config/<app>, ~/.local/share/<app>, etc. Regardless, I think it probably makes sense to have a uniform interface for getting said directories, so that however the OS decides things should be laid out, the developer just needs to `local_config_dir(app_name)`. If the user (or at least administrator) can decide between <app>/<function> and <function>/<app>, all the better.
- ptman 8y agoThe reason ~/.config/app is superior, is that then you can e.g. backup all your configs, or remove your cache, or store ~/.local and ~/.cache on a local fs and the rest of ~ on NFS. Do you have to use ~/.config/app/ or could you just use ~/.config/app.conf?
- zbentley 8y agoRegrettably, OSX recommends the use of the Library/Application Support directory, and provides several utility APIs for getting config/cache/data locations which point there as well: https://developer.apple.com/library/archive/documentation/General/Conceptual/MOSXAppProgrammingGuide/AppRuntime/AppRuntime.html https://developer.apple.com/library/archive/documentation/Ge... In general, if I'm targeting OSX, I use those locations as recommended, but make symlinks to relevant config/etc. from there to the XDG-suggested locations.
- JdeBP 8y agoErroneously naming it "XDG-spec" is not very good, though. It is the "XDG Base Directory Specification", just one of several XDG specs. * https://freedesktop.org/wiki/Specifications/ https://freedesktop.org/wiki/Specifications/ * https://standards.freedesktop.org/ https://standards.freedesktop.org/
- mixmastamyk 8y agoYes, also it should be in the top half, #12 makes it sound not very important. Certainly before "be fancy."