20 Aug
Posted by: Brandon Harper in: Culture, OS X, Operating Systems, Tips, Hacks, & Tricks
At the request of a reader, I went ahead and researched what .DS_Store Files are, and how prevent MacOS X from creating them. In a nutshell, .DS_Store files are created by Finder to store preferences:
.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, Mac OS X will create a .DS_Store file in every folder that it accesses, even folders on remote systems (for example, folders shared over a SMB or AFP connection) 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 Macintosh Finder, which would merely place a number of invisible files at the root of the volume being accessed (even on alien filesystems), always storing the settings and metadata for all of the folders in the entire volume within this single set of files.
Unfortunately it seems that you can only prevent Finder from creating these files on network shares and not on your local machine. Here’s how you do it:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
and press enter
I haven’t found a good way to prevent OS X from creating them on local file systems, but perhaps someone out there has some suggestions? Other than creating a script to delete them and adding it to cron, I’m not sure of a way to at least clean them up in an automated fashion. I did run across an application called DS_Store Cleaner which helps clean-up said files, though.
2 Responses
Cliff
05|Dec|2007 1These files are even more insidious than the Windows thumbs.db files… at least in Windows we only had the .db files when there were pictures in the folder… on the Mac it’s every folder… not a big deal unless you use a product like Eclipse which shows you all of these files!
Alexandre
15|Jul|2008 2Good tip. Tks!
Leave a reply