5 ms·
Related pet peeve: macOs '.DS_Store' files. Can someone better-informed than me please explain how to prevent heir creation? Barring that, I'd settle for a just
by chrisweekly 8y ago
Related pet peeve: macOs '.DS_Store' files. Can someone better-informed than me please explain how to prevent heir creation? Barring that, I'd settle for a justification.
- giornogiovanna 8y ago.DS_Store contains the positions of file icons, the last view mode (list, icons, etc.), and other stuff for Finder. You can avoid creating it by not using Finder, and you can probably also avoid it if you carefully avoid not dragging icons around. If it bothers you because you keep committing it into your Git repo, then you can exclude it in a global .gitignore[0]. [0]: http://egorsmirnov.me/2015/05/04/global-gitignore-file.html http://egorsmirnov.me/2015/05/04/global-gitignore-file.html
- extra88 8y agoThey store attributes used by the Finder for the they're within [0]. You can set a Mac to prevent their creation on mounted network volumes [1] but to my knowledge there isn't an option to prevent their creation on local volumes. For Samba shares, you can configure it to prevent their creation. [0] https://en.wikipedia.org/wiki/.DS_Store https://en.wikipedia.org/wiki/.DS_Store [1] https://support.apple.com/en-us/HT208209 https://support.apple.com/en-us/HT208209 [2] https://e-rave.nl/disable-creation-of-ds_store-files-on-samba-shares https://e-rave.nl/disable-creation-of-ds_store-files-on-samb...
- dmitrygr 8y agoHow else do you propose storing xattrs on fat32?
- Varriount 8y agoJust don't? Besides, .DS_Store files are created on non-FAT filesystems too, even when the filesystem does support extended attributes.
- rovr138 8y agoWindow size, folder view settings, icons locations etc is what I understand is store there. No idea how to prevent them (except on networked folders.).
- zackmorris 8y agoThey're a bug/feature from the early days of OS X. Apple should have done the work of storing directory metadata in something like ~/Library/Preferences/com.apple.finder.plist but they were too busy getting anything at all to work. This is the type of low hanging fruit that Apple evidently doesn't care about anymore, but would go really far towards improving user sanity. It's like when you go to a restaurant and order the cheapest thing on the menu as a way to gauge the overall quality of the food there.
- asveikau 8y agoLeaving it next to the files means if directories are moved, copied, or renamed, the metadata is still there. So you or I might prefer it to live in a separate file under ~/ but I cannot say littering the whole tree with the metadata buys nothing or can't serve a purpose.
- zackmorris 8y agomacOS knows when files and directories are moved via inodes: https://eclecticlight.co/2018/03/03/how-macos-tracks-your-files-inside-the-inode/ https://eclecticlight.co/2018/03/03/how-macos-tracks-your-fi... so I can't see any conceptual reason to keep .DS_Store.
- zapzupnz 8y agoBecause macOS doesn't know when files and directories are moved on other devices, network drives, etc. Nor can it preserve that metadata across other devices, network drives, etc. without copying it across somehow; the easiest solution was to store that data in hidden files and let Finder handle their automatic transfer. Failure of your imagination isn't failure on someone else's part.
- zackmorris 8y agoHmmm this is the first good argument I've heard for the existence of .DS_Store files. You get a point :-) I'd be curious to test this, by zipping folders, copying them to other machines, etc. My gut feeling is that Apple probably missed something and it doesn't quite preserve the metadata like it should (most likely due to version incompatibilities or duplication of state somewhere else in the OS that overrides it). I'd be pleasantly surprised if it did work though. It brings up another point however, that probably metadata is as important as data (and sometimes more important, if you look at how we organize data today). The earliest filesystems probably should have implemented multidimensional storage somehow, similar to the metadata in the BeOS filesystem. I'm not familiar with how it's implemented, and it probably also breaks when files are copied to another filesystem, unfortunately: https://news.ycombinator.com/item?id=12309686 https://news.ycombinator.com/item?id=12309686
- skinnymuch 8y agoYou can use https://github.com/JK3Y/asepsis https://github.com/JK3Y/asepsis to have them all redirected to one folder. So not have them in every folder. That’s forked from the project originally being by TotalFinder’s creator as far as I know.
- saagarjha 8y agoA couple of caveats: one, it seems to inject into other processes, which is not something you want to do with System Integrity Protection enabled, and two you need to run touch ~/.no-asepsis-os-restriction to make this work :)
- skinnymuch 8y agoDefinitely! I should’ve said something with the caveats. Thanks for doing so!