6 ms·
.DS_Store
- GekkePrutser 6y agoAka trash left by macOS on usb drives, network shares etc :) Yes I know they serve a purpose and Windows does it too :)
- korginator 6y agoAnd on every single directory on your Mac that you visit using Finder. Not just on USB drives and network shares. MacOS has done some interesting things with extended attributes and other metadata, but why in God's name can't we get rid of the .DS_Store is beyond me. Here's something even better. When copying files across to non Mac file systems, be prepared for a ton of files with names like "._.filename". Once in a while I clean out the clutter: $ find $DIR -type f -name .DS_Store -exec rm '{}' \;
- Anthony-G 6y agoI don’t have access to a Mac but the command should be faster if you change the semi-colon to a plus-sign: find $DIR -type f -name .DS_Store -exec rm {} + Completing the `-exec` predicate with the plus-sign results in only one fork-and-exec call to the `rm` command (as long as the number of arguments doesn’t exceed the system’s `ARG_MAX` limit), similar to how the `xargs` utility aggregates arguments into sets. This feature has been in POSIX for many years so I’m guessing it should be available with the Mac OS X version. If you install GNU find, it also includes a `-delete` action so there’s no need to even call an external command to delete files.
- jjjbokma 6y agoeven better: find has a -delete: find $DIR -type f -name .DS_Store -delete +
- js2 6y agoThe underscore files store the resource fork when copying to to a non-MacOS filesystem: https://en.wikipedia.org/wiki/Resource_fork https://en.wikipedia.org/wiki/Resource_fork https://en.wikipedia.org/wiki/AppleSingle_and_AppleDouble_formats https://en.wikipedia.org/wiki/AppleSingle_and_AppleDouble_fo...
- GekkePrutser 6y agoYou can turn it off with a simple plist setting... But then it turns it off on all drives, including ones that do have resource fork support, strange enough. There's no setting that I could find that just turns it off for network and usb drives formatted with non-Mac filesystems.
- sidpatil 6y ago> Aka trash left by macOS on usb drives, network shares etc :) I never thought about it that way! It's digital littering.
- throwaway8581 6y agoWindows literally does not do it. Thumbs.db files are now stored in an OS controlled directory, not in user folders.
- deleted 6y ago[deleted]
- karmakaze 6y agoOS/2's HPFS had a similar annoying thing creating "EA DATA. SF" files, but only on FAT filesystems. On an HPFS filesystem they were stored in an alternate 'extended attributes' stream also associated with the filename. MacOS also has alternate file streams but chooses to create these annoying ".DS_Store" files on every filesystem.
- GeekyBear 6y agoIt's the Mac equivalent of thumbs.db from Windows. Serves a purpose on one OS, and that OS hides it from view by default.
- Daho0n 6y agoWindows have moved on. They are now stored in \%userprofile%\AppData\Local\Microsoft\Windows\Explorer. Apple need to fix it too.
- zajio1am 6y agoAre these really the same? Seems to me that thumbs.db is just thumbnail cache, which is just redundant data and can be lost when copied, while .DS_Store stores user data associated with folder (like icon positions), so they should be kept when copied.
- GeekyBear 6y agoIt's just as disposable as thumbs.db. The Finder won't remember you choosing custom view settings for that folder, or if you have assigned custom positions for icons in that folder. Neither loss is problematic. If you are accessing shared directories, you can simply turn off storing that data in the shares, completely.
- GeekyBear 6y agoThat doesn't change the concept or it's long history of use on Windows.
- jmcvaughn 6y agoTo stop macOS creating these on USB volumes and network drives, at least: defaults write com.apple.desktopservices DSDontWriteNetworkStores true defaults write com.apple.desktopservices DSDontWriteUSBStores true
- Brian_K_White 6y agoI always shake my head in perplexity at people just living with annoyances for decades instead of taking 5 minutes to google something. Well I am guilty on this one. I should not have learned this from a HN comment. But I did, so all that's left is THANK YOU.
- swyx 6y agoyou can also add .DS_Store to the global gitignore, fwiw
- linux2647 6y agoDoes anyone know how the things provided by .DS_Store worked in classic MacOS? Before OS X? IIRC there weren’t such files but folders would remember icon placements and custom folders/file icons
- deleted 6y ago[deleted]
- kalleboo 6y agoIn classic MacOS they were stored directly in attributes in the filesystem (HFS) and were handled by their proprietary network file sharing (AFP). On foreign file systems (mainly FAT32, UDF was also supported), icon placements were simply not remembered. Since NeXTSTEP (and hence early OS X) had boot drive support for other file systems (UFS) and other networking standards (NFS) they needed a generic solution that worked everywhere. https://en.wikipedia.org/wiki/Hierarchical_File_System#Design https://en.wikipedia.org/wiki/Hierarchical_File_System#Desig... > The File Record also stores two 16 byte fields that are used by the Finder to store attributes about the file including things like its creator code, type code, the window the file should appear in and its location within the window > Like the File Record, the Directory Record also stores two 16 byte fields for use by the Finder. These store things like the width & height and x & y co-ordinates for the window used to display the contents of the directory, the display mode (icon view, list view, etc.) of the window and the position of the window's scroll bar.
- deleted 6y ago[deleted]
- kjjjjjjjjjjjjjj 6y agoKind of a double standard since thumbs.db exists yet no one ever talks about it. People love hating on apple
- lexicality 6y agoI've not seen thumbs.db in years. Either Windows (and cygwin and msys and wsl) are very good at hiding them or they're not created any more.
- gruez 6y agoA sibling comment has mentioned that it's basically a non-issue on windows because they stopped doing it. https://news.ycombinator.com/item?id=26437553 https://news.ycombinator.com/item?id=26437553
- wayneftw 6y ago> People love hating on apple On HN? No, quite the opposite - people literally defend the app store monopoly and the lack of control over their own devices claiming that they're thankful for it keeping "the children" safe. Hackers indeed.
- kjjjjjjjjjjjjjj 6y agoyou are welcome to run an insecure OS on some chinese made device with no platform security. I won't lose any sleep over it
- wayneftw 6y agoNo thanks. I'd rather have my country force Apple to loosen up, especially since most people are running an iPhone here and you cant do business without going through Apple. Monopolies get broken up here or are forced to unbundle like we did with Microsoft.
- kjjjjjjjjjjjjjj 6y agoMicrosoft was not making the hardware they were monopolizing. Apple makes the entire stack end to end. You are welcome to just not use apple products if you don't like it. I like the integrations and protections I get from a device built with privacy and security in mind.
- happytoexplain 6y agoI always assumed .DS_Store was equivalent to thumbs.db, as multiple comments have pointed out, but it got me thinking: I move files and browse shares between Windows and macOS all the time - why do I (and it seems like everybody else) always notice .DS_Store files, but never notice thumbs.db files? Does Windows not consistently write it to attached storage? Does macOS respect Windows' hidden flag on shares? Is there some other practical reason?
- gruez 6y ago>why do I (and it seems like everybody else) always notice .DS_Store files, but never notice thumbs.db files? https://news.ycombinator.com/item?id=26437553 https://news.ycombinator.com/item?id=26437553
- happytoexplain 6y agoWell that would explain it.
- GeekyBear 6y agoEven when they were in use, Windows hid thumbs.db files from you by default, just as Macs hide .DS_Store files from you by default.
- wmu 6y agoThe article mentions that the format was reverse-engineered, but the link goes to some extension database page, without any further details. Is the format really known?
- 9935c101ab17a66 6y agoDoes anyone know of any sources that outline a more elegant way to handle this? Would it be something like a data store in the users library that just somehow keeps track of the same data? Are there practical reasons that still make .DS_Store a compelling solution? Kinda interested how you’d go about designing something like this, and I don’t have much FS knowledge.
- ipsocannibal 6y agoPSA: Please add .DS_Store to your .gitignore template. You'll make all your non-Mac using coder friends a little happier.