.DS_Store Files

5 05 2007

Ever wondered what those .DS_Store files on your network drives are? They are simply metadata about folders such as window and icon positioning, etc.

They will usually appear on network drives that are accessed by mac users with write access (even if they don’t add or modify anything to the file tree), and on removable media used by macs.

For those that aren’t as familiar with the inner workings of the mac filesystem, I’ll give a brief rundown. Back in the day, Apple decided that they should separate the data and resources inside files into two separate forks. For example, your application file might contain the binary exacutables in the data fork, and other files such as icons, GUI widgets, and libraries in the resource fork. It’s a good idea in practice, and in times past, was very relevant to the way macs work. Since OS X, this has not been as relevant, and makes inter-operability with other filesystems difficult.

The .DS_Store is merely a representation of the resource fork of a folder (or directory, for unix purists), and contains the details of how a folder should appear in the spatial model of OS X’s finder, and serves the same purpose as the desktop.ini in Windows Explorer. Unfortunately OS X has, in every version so far (to 10.4), automatically created this file on any non-native filesystem that it has write access to, even if no changes are made to anything else on the disk.

The big question is How can I stop Finder creating .DS_Store files?

Fortunately, you don’t have to know all of the above to stop it. You can safely delete these files if you encounter them, but to stop them being created in the first place, run this line in the Terminal app on your mac:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Simple!


Actions

Informations

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>