zlacker

[return to "Understanding the bin, sbin, usr/bin, usr/sbin split (2010)"]
1. bjourn+6f[view] [source] 2022-05-11 08:38:10
>>taubek+(OP)
Roughly the same reason why dotfiles became a thing on Unix: https://linux-audit.com/linux-history-how-dot-files-became-h... Fortunately more and more software is putting its config in ~/.config/ rather than dumping it all over users' home directories.
◧◩
2. sph+Xg[view] [source] 2022-05-11 08:57:59
>>bjourn+6f
AFAIK the XDG spec isn't a thing on macOS, so you get those CLI utilities written by devs on their fancy Macbook Pro that pollute your home directory, such as Deno, Doom Emacs, Elixir, Rust/Cargo, Kubernetes, npm, vscode, etc.
◧◩◪
3. jeroen+7e1[view] [source] 2022-05-11 15:10:39
>>sph+Xg
I can understand devs not using the right circumstances if their platform of choice doesn't come with an easy way to determine the right directory to put stuff in, let alone create it if necessary.

What I really want is an API that does "create/open/delete a file/directory for the relevant configuration/cache/resources store", be it user configured or platform default. What I get is an external package that gives me a list of potential storage locations (of which I'll probably just pick the first) that may or may not be actual directories on the system which I may or may not have access to touch files in.

Some devs are kindly reminded that there's a spec for these things but often it's too late as data is already in specific paths that users may have come to know. That way you end up with paths that get set by environment variables where you have to tell each and every program where to put their crap.

Other programs don't care enough to implement the standards (like Firefox; the bug report about XDG is old enough to vote [1] and it's still not implemented fully). Kubernetes has an open issue for its client that only ever gets bumped.

Even worse are devs that are reminded of standards like XDG and then decide to give everyone the middle finger. Snap is one of them, not only is the data directory hard-coded, it's hard-coded lowercase unlike every other standard directory on Canonical's distribution itself! Snap's biggest competitor, Flatpak, decided not following the standard is not a problem [3]. At least it's special snowflake folder starts with a period so that it's hidden by default, I suppose. Even Bash doesn't support XDG [4] because not everyone uses Linux (and apparently no effort should be made to support OS specific standards?) with the suggestion closed as won't fix.

Many tools that do support XDG only care about their own standards, of course; Windows has had SHGetKnowlFolderPath since Vista, replacing SHGetFolderLocation which dates back to Windows 2000. Still, developers like to push POSIX standards into Windows, creating .dotfiles and not even bothering to at least mark them as hidden.

There's a big list on the Arch wiki[7] listing programs and their compatibilities with XDG.

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=259356

[2]: https://github.com/kubernetes/kubernetes/issues/56402

[3]: https://github.com/flatpak/flatpak/issues/1651

[4]: https://savannah.gnu.org/support/?108134

[5]: https://docs.microsoft.com/en-us/windows/win32/api/shlobj_co...

[6]: https://docs.microsoft.com/en-us/windows/win32/api/shlobj_co...

[7]: https://wiki.archlinux.org/title/XDG_Base_Directory#Hardcode...

◧◩◪◨
4. fl0wen+Xn1[view] [source] 2022-05-11 15:52:16
>>jeroen+7e1
Incidentally, did you know that PowerShell on Linux respects the XDG specification? It was rather unexpected when I first noticed it and it just tickles me pink.
◧◩◪◨⬒
5. jeroen+5g2[view] [source] 2022-05-11 20:07:45
>>fl0wen+Xn1
I hate the scripting language, but technology wise Powershell is one of the most solid scripting engines out there.
[go to top]