News for hackers. Stuff that matters.
Re:Dotfile madness by ljm on Saturday February 02, 2019 @04:18PM (#19065776)
This strongly reminds me of installing software on Windows, where most games and programs would use My Documents as a dumping ground.
Re:Dotfile madness by int_19h on Saturday February 02, 2019 @07:39PM (#19066927)
Windows actually has the same dotfile infestation problem these days. I mean, you still get stuff in Documents that shouldn't be there, but on top of that you get apps - often Unix ports - that believe that %USERPROFILE% (i.e. one folder above Documents) is the appropriate place for their configs and such (it's not - that should also go into AppData\Local or \Roaming as needed). And they usually use a dot-prefixed name, just because.

I just looked at my Win10 profile dir, and it has 36 dot-prefixed folders, and 7 more files on top level. Offenders include .gitconfig, .rustup, and .vscode, just to name a few.

Re:Dotfile madness by jimmaswell on Sunday February 03, 2019 @12:24AM (#19068030)
On Windows, you could move the configs elsewhere, make a symlink to them in the old place, and mark the symlink as hidden so you don't see it in explorer. Too bad this can't work on Linux because the hidden-state is encoded in the filename.
Re:Dotfile madness by int_19h on Sunday February 03, 2019 @02:15AM (#19068264)
Well, the hidden-bit on Windows is really semantically equivalent to dot-prefix on Unix, and people set up their file managers to show such files for similar reasons (I don't even use Explorer, mostly). In Win10, it's even exposed as a setting in Settings | For Developers
Re:Dotfile madness by SomeHacker44 on Sunday February 03, 2019 @10:38AM (#19070122)
What do you use in lieu of Explorer, out of curiosity?

15 year Mac user (re)exploring Windows due to bad hardware...

Re:Dotfile madness by int_19h on Sunday February 03, 2019 @04:34PM (#19072382)
For actual file management, and generally working in the terminal, I'm firmly in the "two blue panes" club, so it's Far Manager on Windows (and Midnight Commander on Linux). Far is probably the most advanced text-mode file manager in general right now.

https://www.farmanager.com/screenshots.php?l=en

Re:Dotfile madness by rffn on Sunday February 03, 2019 @12:20PM (#19070814)
Compared to 15 years ago I think Explorer is much better now, it could be even called usable.

Nevertheless there are alternatives. One liked by many are Norton Commander alike file managers like Total Commander or even Far. I am not too much in favor of them though.

I like to use Directory Opus. It is powerful and flexible. Costs money though.

Re:Dotfile madness by anothermindbomb on Sunday February 03, 2019 @06:24PM (#19072880)
Re:Dotfile madness by user5994461 on Saturday February 02, 2019 @04:26PM (#19065822)
It's fair to store documents and saved games in My Documents.

Much better than storing them in C:\Windows or C:\Program Files, as was the case a decade ago, before windows introduced UAC and blocked write access to these.

Re:Dotfile madness by SpaceManiac on Saturday February 02, 2019 @04:37PM (#19065897)
It's senseless to store files that don't have user-facing meaning in My Documents. I know games that use it varyingly for web caches, shader caches, binary config files, debug logs, Lua scripts, downloaded mods, and even executables. And while arguably most gamers understand what save files are, they can't be double-clicked to open them, so I don't consider them documents (Maybe this is pedantic).

All this kind of stuff is what Appdata\Roaming and Appdata\Local are supposed to be for.

Re:Dotfile madness by Dayshine on Saturday February 02, 2019 @05:30PM (#19066200)
Save games is a poor example.

Users often need to back them up. Backup systems often include Documents by default but not AppData.

Files in AppData are hidden, and you would not expect users to find them.

Further, many save games can be opened with a text editor just fine :)

Re:Dotfile madness by wongarsu on Saturday February 02, 2019 @06:02PM (#19066381)
I understand not backing up AppData/Local, but everything in AppData/Roaming is supposedly important enough to sync it over the network (if you use domains or another mechanism to give you the same Windows account on multiple computers). Any default policy which doesn't back up AppData/Roaming seems ill advised.
Re:Dotfile madness by user5994461 on Saturday February 02, 2019 @07:16PM (#19066842)
It's ill advised to synchronize game saves by default. Quite a few popular games generate gigabytes of saves.

My witcher saves were 10GB, until I realize that problem and deleted them, no wounder backups were slow. Skyrim is not that far off.

Pretty sure backup is already integrated in steam for these two games.

Re:Dotfile madness by h1d on Saturday February 02, 2019 @11:31PM (#19067865)
I don't know what they save but 10GB is surely not purely saved games. It's those games fault not about 'saving saved games by default'.
Re:Dotfile madness by zingmars on Sunday February 03, 2019 @04:51AM (#19068678)
Nope, Witcher 1 saves are just really large (for some reason in addition to all the flags they also contain some locale data and such). 10GiB is actually pretty reasonable for a Witcher playthrough.
Re:Dotfile madness by user5994461 on Sunday February 03, 2019 @10:24AM (#19070034)
It's similar in the Witcher 2, 3 and Skyrim. The saves start small and they grow to 10MB as you progress in the game. I guess there is a lot of world state and items to hold in an RPG. Count a few hundred saves, manual or autosave and that's a lot of space.

In the witcher 1 there is also an uncompressed BMP thumbnail with each save that is about a megabyte. It's PNG compressed in the witcher 2. They learned from their mistake.

Re:Dotfile madness by Dayshine on Sunday February 03, 2019 @04:19AM (#19068582)
My "Roaming" is 12GB. I don't think Chrome and Firefox listen to that advice.
Re:Dotfile madness by wongarsu on Sunday February 03, 2019 @04:31AM (#19068620)
My AppData/Local is 14GB, mostly caches from Chrome, Firefox and Spotify. My AppData/Roaming is 3.3GB, mostly my emails (with my Browser's localstorage a distant second).

Chrome's cache is in AppData/Local/Google/Chrome/User Data and Firefox's cache is in AppData/Local/Mozilla/Firefox/Profiles/. The only big offender on my system is npm with a cache in AppData/Roaming/npm-cache

Re:Dotfile madness by ygra on Sunday February 03, 2019 @05:31AM (#19068829)
Thunderbird infamously places the local copy of IMAP mails (i.e. Effectively a cache) into Appdata\Roaming. It's the single largest directory I have there. Everything else is quite reasonable in size.
Re:Dotfile madness by ChrisSD on Saturday February 02, 2019 @06:34PM (#19066596)
As noted below there's a special folder called "Saved Games" that's specifically meant for this purpose. A lot of games still don't use it.
Re:Dotfile madness by user5994461 on Saturday February 02, 2019 @07:48PM (#19066980)
To be fair it's widely used now, it just took a while to adopt because of compatibility issues.

Finding the directory requires new APIs introduced in Vista and Server 2008. See SHGetKnownFolderPath

Re:Dotfile madness by ChrisSD on Saturday February 02, 2019 @08:51PM (#19067261)
Sure but in the non-game software world we'd do a runtime check to see if the OS was Vista or later and fallback if not.
Re:Dotfile madness by user5994461 on Sunday February 03, 2019 @10:31AM (#19070075)
You can't do it as a runtime check. You have to compile the software with the flags to import and link to the latest windows library. The program will hard crash if run on an older version.

I just tried to use the API. I literally couldn't find a working example on the internet in 2 hours so I guess noone figured it out in a decade.

Wrote https://stackoverflow.com/a/54499257/5994461

Re:Dotfile madness by ChrisSD on Sunday February 03, 2019 @04:39PM (#19072402)
What's wrong with calling IsWindowsVistaOrGreater[0]?

[0] https://docs.microsoft.com/en-us/windows/desktop/api/version...

Re:Dotfile madness by user5994461 on Sunday February 03, 2019 @05:15PM (#19072586)
You won't have the chance to call anything. If the executable is statistically linked to the latest API, the executable won't be able to load on older systems.

I'm surprised that these new IsWindows...() functions claim compatibility down to Windows 2000. Doubt microsoft knew how they would name their next release 20 years ago. A Google search indicates that they are in fact broken.

Re:Dotfile madness by ChrisSD on Sunday February 03, 2019 @06:58PM (#19073003)
You won't be able to compile with the function imported using the modern lib (because it doesn't exist on XP) but you can conditionally link it at runtime with LoadLibrary/GetProcAddress.

If IsWindows... doesn't work then you can use the VerifyVersionInfo function directly.

Re:Dotfile madness by h1d on Saturday February 02, 2019 @11:28PM (#19067848)
Why did they have to narrow it down to games? Could just go with "Saved config (and data)", so other apps could just dump small config files which can be effectively backed up.
Re:Dotfile madness by runxel on Saturday February 02, 2019 @07:09PM (#19066791)
And here I am, still wanting my save files to reside next to the games exe...
Re:Dotfile madness by ChrisSD on Saturday February 02, 2019 @07:43PM (#19066955)
Fair enough but on multi-user systems you can surely see the value in separate save game folders?
Re:Dotfile madness by chii on Saturday February 02, 2019 @09:34PM (#19067443)
when was the last time a gaming machine is a multi-user system?!
Re:Dotfile madness by h1d on Saturday February 02, 2019 @11:30PM (#19067855)
Since when every person in a house has their own gaming PC?
Re:Dotfile madness by ChrisSD on Saturday February 02, 2019 @09:51PM (#19067505)
I'm currently typing this on a machine that's used for gaming by more than one person.
Re:Dotfile madness by AnIdiotOnTheNet on Sunday February 03, 2019 @11:44AM (#19070570)
There's no reason there couldn't be separate per-user folders within the game's installation path for that.
Re:Dotfile madness by not_kurt_godel on Saturday February 02, 2019 @11:17PM (#19067806)
Do you also store your birth certificate in your car's glovebox?
Re:Dotfile madness by runxel on Sunday February 03, 2019 @05:05PM (#19072524)
What a misleading comparison...

I don't even get what you want to say.

Re:Dotfile madness by not_kurt_godel on Sunday February 03, 2019 @08:34PM (#19073337)
A game's exe dir is a long-lived but potentially replaceable thing, like a car. Saved games may be persisted across game versions, so you don't necessarily want them to be in the same directory. Admittedly not the best analogy, but was just observing that it's strange and incongruent to store the 2 together.
Re:Dotfile madness by jamiepenney on Saturday February 02, 2019 @08:25PM (#19067151)
I haven't used My Documents for documents for years now. The directory is useless because of all the cruft, I store useful things elsewhere now.
Re:Dotfile madness by h1d on Saturday February 02, 2019 @11:33PM (#19067873)
My Documents meant as /var/tmp to me ever since it existed. Never put my own files there.
Re:Dotfile madness by sixothree on Saturday February 02, 2019 @06:51PM (#19066693)
It is not okay for some application to store files in My Documents folder. If it's not MY document then it doesn't belong in My Documents.

The user folder exists for a reason. Drop your crap in there.

Re:Dotfile madness by jimmaswell on Sunday February 03, 2019 @12:28AM (#19068043)
It hasn't been "My Documents" since Windows XP. It's just "Documents" now, so if we're taking the name literally, then any document can go there.
Re:Dotfile madness by sixothree on Sunday February 03, 2019 @12:41AM (#19068072)
To be pedantic, My Documents still exists as shortcuts in the user folder.
Re:Dotfile madness by h1d on Saturday February 02, 2019 @11:22PM (#19067828)
That's why I just let them be and create 'Data' folder at the drive's root where no one will taint and to keep the way I want organized.
Re:Dotfile madness by eeeeeeeeeeeee on Sunday February 03, 2019 @12:00AM (#19067962)
Which is sort of an improvement from the past, where user-level config data was thrown into the actual app directory in "program files." So if you ever wanted to back-up those settings, you needed to track down every single unique location for each app.
Re:Dotfile madness by jeffchien on Saturday February 02, 2019 @06:37PM (#19066618)
If it's the entire game, it might be to allow kids to install the game without administrator privilege (read: parental knowledge/consent), though I agree that letting people choose would be best.
Re:Dotfile madness by Spivak on Saturday February 02, 2019 @08:46PM (#19067245)
If your kid can write and execute in any directory on your system then they can run whatever software they like.
Re:Dotfile madness by jeffchien on Sunday February 03, 2019 @03:11AM (#19068397)
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.
Re:Dotfile madness by Spivak on Sunday February 03, 2019 @09:21AM (#19069658)
Sorry, definitely missed the context on that one. Why wouldn't you want to install in AppData/local?