Live data from Hacker News

Dotfile madness

0x46.net

461–470 of 534 posts

Re: Dotfile madness

#461
post #297

Earlier quoted context omitted.

I personally don't like xdg. I have bin files from pip and other stuff in ~/.local/bin. I have huge amounts of cache files in both .cache and .config. It's supposed to make my life easier by being able to backup .config and dump everything. but in reality this doesnt happen. Backing up .config for just the user defined configs is a massive PITA. you have to put so many gitignore exceptions and I'm not even talking ab…

Can you ln -s /tmp .cache. ?

You can export XDG_CACHE_HOME=/tmp

Re: Dotfile madness

#462
post #354

Earlier quoted context omitted.

I have great difficulty understanding why the snap developers think the excuse “it’s hard to change!” flies. If it’s hard to change, you should’ve either fixed your architecture from the start, or thought a bit harder about the implications of magically creating a new directory in $HOME.

It shouldn't be hard to change unless the string "/snap" is hardcoded all over the codebase. There should be a function like "get_app_dir" or "get_install_dir" or some other config string lookup that doesn't use a static string.

They probably mean it's hard to migrate existing users and not break.

Re: Dotfile madness

#463

Earlier quoted context omitted.

Apple's Macintosh did this in 1984. Files were tagged with 32 bit codes: one for the "creator" (the associated app) and one for the type. These were often made up out of readable characters: a so called "fourcc" (four character code). The "fourcc" persists in cross-platform media formats.

The first software I ever sold online was an app that would change the creator code of a file to whatever application you wanted. For some reason, there was no obvious built-in way to do that in Mac OS 8 (besides opening the document in the other application and saving it, or changing it in ResEdit). I only ever sold one license, but I was 12, so I was pretty excited.

If that can be done, doesn't it defeat the purpose here? Anything can create a file, and then change this tag to 'system' or whatever.

Re: Dotfile madness

#464

A lot of other people have made some fantastic points here, so I won't harp on "putting random crap in ~/ bad!" any further. However, since it has not been mentioned, I would like to shout out to the Python "appdirs" module[1], which neatly solves this issue for those writing programs in Python with minimal effort. The best part is that it uses the platform's native standards, so XDG on Linux, plus whatever macOS and…

> The best part is that it uses the platform's native standards, so XDG on Linux, plus whatever macOS and Windows call their implementations.

Boo. Apps not using XDG on macOS drive me mad anyway; 1000 times more so when they do on Linux, but use Library or whatever stupid place on macOS despite the presence of XDG environment variables.

Re: Dotfile madness

#465
post #35

Earlier quoted context omitted.

Linux has been and is a tinker OS for folks who know wtf they are doing. As time progressed it has become easy enough folks who dont know what they are doing can use many of the distributions. Those folks are destroying what used to be a wonderful intelligent linux community.

You realize this is the definition of gatekeeping, right?

Computer "engineering" is the only unregulated engineer I am aware of because of the damage they can do to society.

It is time we started doing that

Re: Dotfile madness

#466
post #355

Earlier quoted context omitted.

If your kid can write and execute in any directory on your system then they can run whatever software they like.

What? I'm not sure how that connects to my comment. I'm saying that some games install to "My Documents" to avoid requiring administrator privilege for users who might not have that privilege.

Sorry, definitely missed the context on that one. Why wouldn't you want to install in AppData/local?

Re: Dotfile madness

#467
Why do we even need hidden files? Why not just put all the configuration files/directories under a single directory specifically dedicated for this and use file system attributes for all the directory-local metadata?

Re: Dotfile madness

#468

Earlier quoted context omitted.

C:\ isn't protected by UAC like C:\Program Files, though

Steam is doing just fine writing into C:\Program Files (x86)\Steam\steamapps from an unpriviledged process. It just gives all users full rights over that folder. (whether that's a great idea is a different question, but UAC isn't a problem if you just set your access rights correctly)

This assumes the user had admin privileges to begin with

Re: Dotfile madness

#469
post #176

Earlier quoted context omitted.

Respectful Windows apps should drop their leftovers under %UserProfile%\Application Data or %UserProfile%\Local Settings\Application Data .

This x1000 but even Microsoft products are creating dotfiles in the users profile directory now and not in AppData where they should be.

Yep, I'm looking a .dotnet a .nuget and a .vscode folder right now.

Re: Dotfile madness

#470
I realised that keeping a clean user home directory was futile long ago... this is not even unique to linux or *nix.

Just don't put anything you care about in home directories: in the modern world people own computers not user accounts, you likely have ultimate control over your system, therefore designate your own "home" directory, don't give the other "developers" the choice to polute it by making it non-standard.

I like to be able to nuke my user-home directory whenever I like, I achieve this without pain by additionally placing my hand picked application configurations that I care about into a read only XDG config directory.

Post reply on HN