4 ms·
Also on macOS, where [~]/Library/ApplicationSupport is the designed and recommended place to store config files, logs, preferences and all kinds of persistent d
by franky47 8y ago
Also on macOS, where [~]/Library/ApplicationSupport is the designed and recommended place to store config files, logs, preferences and all kinds of persistent data, the home directory still gets cluttered.
It's a laziness issue, it won't be solved solely by making is easier to access the right locations on each system/platform, but that would be a step in the right direction.
- afiori 8y agoI would honestly like to blacklist my home folder. Do you want to create a new file/folder? I am notified with a popup and if you ask to often I am gonna stop using that. Not really workable but one can still dream...
- gh02t 8y agoThis is actually possible (on Linux, at least, probably Mac/Windows too) with something like selinux. It ends up being a huge headache though, both because selinux is kinda hard to configure, and because you will get a constant barrage of requests.
- giornogiovanna 8y agoThat sounds pretty funny, it reminds me of [UAP](https://blog.codinghorror.com/windows-vista-security-through-endless-warning-dialogs/ https://blog.codinghorror.com/windows-vista-security-through...).
- kalleboo 8y agoThat's how sandboxed apps (=app store apps) on macOS work. They can only access files and directories that the user has explicitly selected (through the system file dialogs or drag and drop)
- amaccuish 8y agoI have no idea how macOS organises its stuff. There's like 10 levels in my Library Folder, and some of them just repeat higher levels.
- gumby 8y agoThose are containers (sandboxes)
- AnIdiotOnTheNet 8y agoAt this point the right solution is to just not allow applications to choose. Give each their own view of the file hierarchy but keep all the crap they spew out in a location obviously related to them from the user's view of the file hierarchy.
- MereInterest 8y agoWhile this cleans up the file hierarchy, it absolutely destroys any interoperability between programs. If a program cannot output files that other programs can see, then it cannot output files that other programs can use as input. Between having a messier file hierarchy on the one hand, and not being able to open a Microsoft Word document outside of Microsoft Word, the former is by far the lesser evil.
- mr_toad 8y agoiOS gets around this (sort-of) with permissions. If you want gmail to be able to email your photos you have to give it explicit permission.
- int_19h 8y agoFor GUI apps, this is trivially solved by requiring the standard Open File/Folder dialog to be used. The system can then control the presentation, and once the user has picked a file, provide the app with a security token that encodes that permission (or even just an open file descriptor). So apps can see each other's data, but only when user explicitly directs them towards it. This is more or less how it works in Win10 UWP apps.
- macintux 8y agoUsing the filesystem for primitive “interoperability between programs” is increasingly recognized as a serious security problem. As someone else in this thread pointed out, a video game can access their tax returns.
- kalleboo 8y agoThis was a bigger problem in the earlier days of OS X (I even created a "Actually My Documents" folder inside the Documents folder to work around it), but now I'm down to two offenders - Adobe and DVDFab.
- joshvm 8y agoWindows also has an app data folder that contains a whole mishmash of stuff. And of course you have the registry. Part of the problem in Windows is that Program Files is write protected for security, so you can't store a local configuration file relative to the exe. So where does it go? I assume there must be documentation from Microsoft and Apple about best practices for this... I hope? To answer your last question: in Qt you can use QSettings and it'll write to a canonical platform-specific location. Useful for storing eg the last accessed folder in a GUI, or things which users don't reallty need to change regularly.
- int_19h 8y ago> Part of the problem in Windows is that Program Files is write protected for security, so you can't store a local configuration file relative to the exe. So where does it go? This hasn't been a problem since the first version of Windows that had a filesystem with such protections - that would be Windows NT 3.1. The correct location for such stuff is %USERPROFILE%\AppData\Roaming or ...\Local, depending on whether those settings are machine-specific, or should be synced across all devices for that user accounts (in environments where this is appropriate, such as domain networks). This particular location is in use since Vista - before, the names were slightly different ("Application Data"), but in any case a well-behaved app is supposed to use Win32 API to retrieve the correct path, rather than hard-coding it - which also worked on Win9x. > I assume there must be documentation from Microsoft and Apple about best practices for this... I hope? Of course. https://docs.microsoft.com/en-us/windows/desktop/shell/known-folders https://docs.microsoft.com/en-us/windows/desktop/shell/known... https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html https://developer.apple.com/library/archive/documentation/Fi... The problem is that so many apps just straight up ignore all those guidelines.
- joshvm 8y ago> The problem is that so many apps just straight up ignore all those guidelines. The fact it happens so often suggests that the documentation isn't good enough. > Of course. At least Apple's pages is pretty clear and has some nice diagrams. I think this page is more appropriate: https://docs.microsoft.com/en-us/windows/desktop/shell/csidl https://docs.microsoft.com/en-us/windows/desktop/shell/csidl It's reasonably well documented for UWP, though I can't find an equivalent for Windows: https://docs.microsoft.com/en-us/windows/uwp/design/app-settings/store-and-retrieve-app-data https://docs.microsoft.com/en-us/windows/uwp/design/app-sett... Hence why I suggested that Qt has the right approach. It also has http://doc.qt.io/qt-5/qstandardpaths.html http://doc.qt.io/qt-5/qstandardpaths.html which abstracts out standard paths for cross-platform applications.