Everything You Didn't Want To Know About The Macs .DS_Store Files

If you’re a Windows user and if you’ve ever exchanged files with a Mac user, chances are you’ve encountered them. Little files called .DS_Store suddenly infecting your otherwise pristine folders. Those are files created by the Mac OSX operating system. Files that store “meta data” about that folder. Wikipedia elaborates:

.DS_Store (Desktop Services Store) is a hidden file created by Apple Inc.’s Mac OS X operating system to store custom attributes of a folder such as the position of icons or the choice of a background image. By default, the Mac OS X Finder will create a .DS_Store file in every folder that it accesses, even folders on remote systems […] and even if the user has only customized the appearance of the folder by moving its Finder window. This is in contrast to the preexisting system for the same purpose used in previous versions of the Finder, which would merely place a number of invisible files at the root of the volume being accessed (even on alien file systems), always storing the settings and metadata for all of the folders in the entire volume within this single set of files.

In case you haven’t picked up the suck in the above explanation, let me list them here for you in simple words that you can understand:

  • Every folder the Mac accesses, local, external or alien, gets a file.
  • The files appear even when they’re not needed.
  • Things could’ve been different. There could’ve been only one file per drive.

As should be excrutiatingly clear from the above bulletted list, .DS_Store files are—at best—an inelegant solution to storing metadata, at worst, they’re totally useless.

Arno used to work with Apple. He worked on the Mac OS Classic Finder and he was part of the rewrite that was done for OSX. In a blogpost he explains that it’s actually a bug that causes the files to be created everywhere, a bug that to this day still hasn’t been fixed.

While it’s a bug, it’s also a fun bug! It’s a bug that means any Mac user browsing your Windows drive will leave a little glowing trail of breadcrumbs that can soon be retraced. Sometimes with hilarious consequences. Privacy infringing hilarious consequences.

As fun as that might be, there’s plenty of reason to despise those trails. In fact, a visit from The Mac is akin to a visit from a rude guest. You offer him a piece of pie and he proceeds to drop crumbs wherever he goes.

Having cleaned up after The Mac for the umpteenth time the other day, it wasn’t long until I was registering my disgust throughout the Twitterverse. The responses from the zealous Mac nuts were routinely apologist and argued that the .DS_Store files are simply hidden files you never see, and that if Windows was only a leetle beet Unix friendly, it wouldn’t be a problem.

Problem is a funny word, but so is decroded piece of crap. Even if it’s a hidden file, it’s still a file, and files aren’t welcome unless you choose “Save” somewhere. Sweeping dust under the carpet isn’t really cleaning the house, is it? To me it sounds like a classic example of overwhelming stupidity vs. the Mac apologists. The Mac should fix its bug and rid the world of the .DS_Store scourge. At the very least, network drives should be exempt from infection. I find this truth to be self-evident, and I challenge you to counter my arguments. In the words of George W. Bush: bring it on!

13 thoughts on “Everything You Didn't Want To Know About The Macs .DS_Store Files”

  1. Tom says:

    Are you sure you aren’t calling the kettle black?

    Prevent the creation of .DS_Store files on Network volumes in MacOS:

    • Open the Terminal application from the Utilities folder which is nested in the Applications folder
    • In the newly opened terminal type (all on one line) defaults write com.apple.desktopservices * DSDontWriteNetworkStores true
    • Restart the computer for the change to take effect
    1. Joshua Rodman says:

      Yes, I did that some years ago.

      Now how do i get the mac to stop creating those files in all my non-network volumes? Seriously, the files are a plague. They insert themselves everywhere wanted or not. There’s really NO reason at all to store them in every directory. There’s so many better possible solutions.

      The whole finder treatment of dotfiles makes it impossible to live in peace with these turds. You can choose to hide all dotfiles, in which case you can’t EVER open a dotfile in a finder window (such as a file-open dialogue). Or you can show all files, and have a .ds_store in your face in every directory.

      Dotfiles are not designed to hide system artifacts. They were invented to conveniently tuck user-specific configuration files out of sight of the user’s normal activities, but in reach the moment they needed to see them. Abusing this to store system cache data is retarded.

      That they can’t even bother to store the cache data centrally, or out of band in filesystem attributes shows Apple engineering to be subpar.

  2. Dave Child says:

    It’s hard to decide whether I hate .DS_Store or thumbs.db more. At least you can tell windows not to create thumbs.db files – Folder Options > View > Do Not Cache Thumbnails.

  3. Joen says:

    Hmm. The Thumb.db file. Good counter argument.

    I was about to say I was in the lucky position that I wasn’t defending Windows, because I really hate many aspects of Windows, but I do see that I made the comparison. Oh well, moving on.

    The point remains: .DS_Store files suck, and if they can be disabled, why aren’t they by default?

    That would be a

  4. Well, that whole point of storing them in the folders they pertain to, is that they are moved with them. This is used very much in OS X (install disk images for instance), and allows you to move an external HDD between several machines, and retain all your settings for that drive.

    1. Joshua Rodman says:

      Yeah it’s not like this could be solved with file modifications notification, and some basic system services.

      Oh wait, it could.

      Alternatively they could just store the data not in a file, but in out-of-band filesystem storage. I mean.. I understand how this might be difficult since Apple uses third party filesystems… oh wait not they maintain their own.

  5. Joen says:

    Well, that whole point of storing them in the folders they pertain to, is that they are moved with them.

    Hmm, another good point.

    Still — it shouldn’t be created all the time, and it shouldn’t be created on foreign drives.

  6. They are annoying as hell.

    And as far as I understand, they aren’t even necessary after the mac filesystem got resource forks.

    @Michael – I definitely think it’s up to Mac OS X to not litter everyones drives with these files, so even if the “move with the folder” argument makes sense, it’s still shitty behavior on:

    1) Network drives

    2) Non-Mac filesystems

    To store the information on your system drive is nothing like the registry, and the bother of recreating the settings if the folder is moved is fine and placed the right place, compared to have everyone else being bothered by DS_Store files.

    Also, the store-with-folder is stupid for any kind of shared, since my weird viewing settings might be completely different from yours.

    There is no way to argue that .DS_Store files on non-mac volumes or shared volumes are an ok solution – at best you can argue that you don’t give a crap because you are a mac user and it doesn’t affect you.

  7. Brian, could you explain why?

  8. Michael, sure.

    It’s obviously bad form for software (and especially an OS) to litter small files all over the place when not asked to. On your own drive, it’s acceptable, since it’s under the OS control and can hide those files.

    On other file systems, it has no such guarantee (as we can see), and on network drives, they are most likely shared with others, and the littering computer has no option to make the files hidden for others.

    It’s ugly to write stuff to directories just because you access them. It’s doubly ugly to do it on drives that are outside your regular jurisdiction.

    Joen already made the arguments.

    How would you feel if Photoshop, 3D Studio Max and Windows Explorer all wrote their own little hidden config files in every single drive the accessed on all paths?

    Imagine you have to find a hidden file one day, and realize that there are heaps of stupid hidden directories everywhere?

    And if you were browsing to the company’s texture network share, the file browser would switch to huge 256×256 icons in a low details grid view, because some other person preferred to view the directory that way?

    I agree that Windows should have a setting to honor linux hidden filenames, which would make it less annoying, but I really think it’s quite self-evident why it’s a bad idea on any drives but your own.

  9. I largely agree, so there’s no need to convince me. What I was asking about, and I should have specified it, was this:

    And as far as I understand, they aren

  10. Jenny-fa says:

    Besides the .DS_Store files, I’m pretty sure Mac also generates other hidden files like FINDER.DAT and FILEID.DAT; I’ve found the former sprinkled liberally throughout my external hard drive. I read somewhere that these are created by the pre-OS X versions of Finder… but I use OS X, so I don’t see where the heck they could have sprouted from.

Comments are closed.