Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: os: add UserConfigDir #29960
With those two functions, I believe there's only one piece missing; a configuration directory. Too many applications write "dot files" under the user's home directory, and that's bad practice. Some others hard-code
Relying on XDG base directory vars like
We're only left with third-party libraries like https://github.com/shibukawa/configdir, which are moderately popular. In practice, popular software tends to write their own implementations. Below are some examples:
I propose adding
I don't know about plan9, but given that the cache dir is
Please note that I'm not suggesting adding support for XDG base directories into the
The only disadvantage I see with adding this API is that one could say we'd be encouraging users to store data files into
@mvdan, yes but Rob's point is that the config dir is just $home/lib (not $home/lib/config). There's not an obvious cache dir on Plan 9 and I abused $home/lib by making a cache subdirectory.
We chatted about this at proposal review, and UserConfigDir seems fine. None of us can explain what UserDataDir would mean or be appropriate for vs $HOME, so let's be sure not to do that one. :-)
Marking approved for UserConfigDir.
Ah, I understand now. I guess we could always use
I personally tend to not find
I'll send a CL shortly, so that it can be reviewed early during the cycle.
FWIW, there's not much to discuss. The idea of a user config dir is well-defined on Plan 9 and is