Blog

Say Goodbye To .DS_Store Files, Resource Forks And Thumbs.db Files On A Windows/Mac Network!

Slowly but surely I’ve started to migrate the computers in the office from PCs to Macs. I’ll admit it, I’ve fallen in love with the aesthetic, OS and functionality just like the millions of other Mac nerds across this glorious planet. During my transition I’ve encountered just about every problem you can think of, from getting Macs and PCs to talk, to getting my Macs to print to shared Windows printers.

Nasty .DS_Store File Listing

Well, finally, I can say that I’ve gotten managing a multicultural network down to a science. Today I’ll focus on network pollution. If you’ve ever used a PC and Mac together and shared files between the two, I’m sure you’ve seen .DS_Store and ._ files show up on your PC. While on the Mac you’ve seen Thumbs.db files pop up every once in a while. So, what are these files? Well, I’ll get to explaining them a little later on in this post. What I will tell you now, though, is that I’ve been able to rid my network of this file pollution with a couple of great programs, the modification of some settings on both the Macs and PCs and a lot of experimenting along the way to finally get rid of these pesky files.

Our current office set up consists of 6 computers. There are 3 PCs and there are 3 Macs. I’ll focus on our developers today as they’ve been the ones who’ve benefited the most from a clean network set up. Chris, our senior developer, backs the PC front while the new kid on the block, Lukas, has a nice little Mac Mini to code away on. To the casual computer user, this set up wouldn’t raise any alarms. Once set up properly, the Mac has no problems viewing any of the internal Windows networks that the PCs are on and can easily automatically connect to our shared network drives which happen to be located on a Buffalo Terastation.

Imagine this scenario, which continued for about a week. Chris and Lukas are working together on setting up a new batch of classes for a web app. Chris hands off some of the major code he’s implemented for Lukas for her to put the finishing touches on. Once she’s done, Chris tries to FTP these files to one of our web servers to test and modify. Without the appropriate preventative measures in place Chris would see a nasty .DS_Store file created by Finder on Lukas’ Mac and a resource fork file for each class file she opened and saved.

The directory would look something like this:

.DS_Store
._file1.class.php
._file2.class.php
._file3.class.php
._file4.class.php
file1.class.php
file2.class.php
file3.class.php
file4.class.php

So what are all these files that Chris can see?. What’s an anal retentive nerd to do? How can one live with all this garbage littered on the network drives and possibly the servers they may have inadvertently been FTP’d to? As with anything in life, it’s actually quite easy to rid your network of this pollution once you know what to do.

Lukas would be none the wiser of the garbage trail she’s left on our network drive as these “Mac” files would appear invisible to her. OS X uses these files to store directory and file information, so as a result they remain invisible to the Mac user. The .DS_Store files store the size of the finder window, whether the directory was viewed using icons, a list or column view and various other properties that Finder stores.

The resource forks are another matter all together. What exactly is a resource fork, you ask? Well, Wikipedia defines a resource fork as the following:

“The resource fork is a construct of the Mac OS operating system used to store structured data in a file, alongside unstructured data stored within the data fork. A resource fork stores information in a specific form, such as icons, the shapes of windows, definitions of menus and their contents, and application code (machine code). For example, a word processing file might store its text in the data fork, while storing any embedded images in the same file’s resource fork. While the resource fork is probably used the most by applications and other executables, every file is able to have a resource fork.”

That was so exciting to read and now I’m a resource fork expert! In English, a resource fork acts in a similar fashion to a .DS_Store file except tt stores information about the file rather than the directory. The most popular use I can think for resource forks would be the storing of an icon view of of the associated file so it looks pretty when viewing it in Finder using the icon display setting.

So, now you’re asking: “How does one begin to battle these evil files?” Well, the first thing you can do is visit this page on Apple’s support site: How to prevent .DS_Store file creation over network connections . All right, so eliminating .DS_Store files seems simple enough. Just open up your Mac’s terminal (found in Applications/Utilities) and paste in this little command: “defaults write com.apple.desktopservices DSDontWriteNetworkStores true”. This line will take care of eliminating .DS_Store file creation on network volumes but will do nothing to stop those pesky resource fork files from being created.

Luckily, there’s a few options for stopping the creation of resource fork files. I mentioned the Buffalo Terastation a little earlier. It’s a great product but it does have its drawbacks which I will get to shortly.

I’ve set up the 2 TB version here in the office using RAID 1. This gives me 2 500 GIG drives that I’ve segmented with various directories to help us keep our internal files separated from our development files. For all the great features this little set up has (remote FTP, web based interface, Linux), I do have a few complaints. My biggest issue with the Terastation is the lack of terminal access and the resulting lack of customisation that this configuration allows. You see, if I could get into the box at the command line level then I could probably write a few scripts (or have someone much more skilled than me write these scripts) to take care of immediately deleting or even preventing the creation of these dreaded files in the first place. Had I known that shell access to the Terastation was disabled before hand I might have purchased another NAS or built my own.

I have read up on some open source kernals that have been compiled for the Terastation. Since it uses a variant of Linux for its operating system it’s governed by the rules of the GPL and must make its kernal source open for all to see. The developed kernals look very promising. In order to get these kernals installed, however, in order to install a new kernal on the Terastation, the bootloader must be cracked so that access can be gained to the rest of the system. From what I’ve read it looks fairly easy to to get into. Once you’ve gained access to the bootloader getting into to the rest of the system and modifying the files seems as straight forward as uploading and compiling the kernal of your choice. Unfortunately, my Linux skills are weak and I don’t have the time right now to potentially brick my brand new Terastation as any such modification is a volation of all warranty terms. If you’d like to know more about the efforts being made to hack the Terastation please head here: Wikipedia: Terastation.

So, now you’ve either stopped reading or wondering how I went about preventing the creation of these nasty garbage files on my network volumes. Without a little program called “Blue Harvest” I think that I’d still be dependant upon a hourly wipe of the Network drives by a program like Moo.Trashes which isn’t all that efficient and still leaves these files on my network drive for a short while (If you can figure out how to disable the tips of the day and the annoying bird named “Peavy” then it’s a great program).

So back to Blue Harvest. Besides being the code name for “Return of the Jedi” while being filmed , it’s a great program that takes care of disabling the creation of .DS_Store files and resource forks on shared drives on a network. It can even stop these files from being created on USB thumb keys and connected USB/Firewire back up hard drives that you may use on both Macs and PCs (which is another great gift from the Nerd Gods that brought us this program).

Head over to the Blue Harvest website to learn more by clicking here. Download the free trial and start playing around. Blue Harvest gets loaded onto your System Preferences pane. To get started, click on the Blue Harvest icon at the bottom of your Preferences pane and you’ll be taken to a new window. The interface is compact and uses tabs to help you manage all the functionality that Blue Harvest provides.

So here’s the tab breakdown:

The first tab lets you specify which drive types/folders you don’t want to have .DS_Store files created on. You can either use the links provided or add custom volumes/folders. That’s one problem taken care of with a couple clicks of the mouse!

The next tab lets you specify which files will have their associated resource forks removed when being opened or saved by your Mac. There’s two columns that can be modified. The left column lets you specify which file types are no longer permitted to leave resource forks that let PC users know a Mac opened some of the files in a particular directory. The default file types include many image types, common web files (such as html, php, and asp) and basic text and audio format files. I personally added the following files: class.php, psd, fla, swf, ai, eps, pdf, doc, xls, ppt, and rft which are the extensions of files that I commonly deal with.

Blue Harvest - Resource Forks Management Tab

The right hand column lets you specify which programs aren’t allow to create these nasty files in the first place, adding an additional level of protection to this feature. On the 3 Macs that I have here at the office I’ve outlined the following programs: Adobe Reader, Photoshop, Illustrator, Distiller, In Design, Macromedia Flash and Dreamweaver, Textmate, Text Editor, Transmit, Safari, Firefox, Microsoft Office, Quicktime, iTunes, Finder and Preview. I’ve tried to narrow down any program or file that might touch a network drive to eliminate any chance of resource forks being created.

The forth tab removes some of the other uglies that Macs tend to leave behind with files on non HFS volumes (including servers). The defaults are .Trashes, .Spotlight-V100, and .VolumeIcon.icns. I’ve left this tab with the default settings enabled as I haven’t experienced any problems on my network drives with these files.

The fifth tab lets you remove Thumbs.db files from your Bootcamp or Parallels partitions. And speaking of Thumbs.db files. How do you stop your PCs from littering your network drives with them? It’s actually painfully easy to do. Simply follow these steps in Windows XP:

1. From “My Computer” click on the “Tools” menu item
2. Click “Folder Options”, and the folder options dialog appears
3. Click the “View” tab
4. Check the “Do not cache thumbnails” option

Once done, you’ll prevent Thumbs.db files from being created on your network drives.

Finally, the last tab in Blue Harvest allows you to clean your network drives of .DS_Store and resource forks quickly and easily. Simply drag the connected servers or drives onto the disk icon and Blue Harvest will quietly delete these files off the drives you’ve specified.

So that’s it. I’ve finally gotten to a point where the network drives are free of these polluting files that really don’t serve any useful purpose. There are a few issues with Finder which I will touch on later, but I can live with these issues for now and perhaps my qualms will disappear once Leopard is released. It took a lot of work to get to this point, but it’s nice to finally have network volumes that are as clean as they are organised.

13 Responses to Say Goodbye To .DS_Store Files, Resource Forks And Thumbs.db Files On A Windows/Mac Network!

  1. Hello.
    Thenk you SO MUCH for posting this information. I’m quite a newbie in the Mac world, and I’ve been suffering with the .DS store filres and the ._ forks.
    Your post has been very useful, because I’m working with a network with PCs too.

    thank you again!

  2. Thanks for the great article. However, I have installed Blue Harvest but cannot see the ‘Cleaner’ tab you refer to. I have version 2.0.1 and my tabs (advanced) read DS_Stores, Resources, Disks, Extras and About.

  3. James,

    Thanks for the Blue Harvest info, my anti-mac PC-loving colleagues will be oh so happy!

    Cheers

  4. Adam says:

    Hi – Just too say a big thank you James for this gem. Had the exact same problem and googled my way here trying to find a solution – downloading Blue Harvest as we speak. Thanks for the heads up and good read.

    Cheers Adam :o )

  5. sanket says:

    Hey hav tried it but there is an app which disable it from creating
    it i was using it months back but not able to find it now if u can plz mail me

  6. Tom says:

    Great info!
    Why aren’t these type of ‘utility’ programs included in the Mac OS utilities?
    Just wondering…

    The previous post said that was using some program to get rid off these files (.DS_Store) and can’t remember what it was. I’m using ‘TinkerTool’. It has the option to prevent a the Mac from writing the .DS_Store files over a network (without the need to use command line in the terminal) I don’t think it prevents the ._ files from being written over the network, but don’t take my word for it.
    http://www.bresink.de/osx/TinkerTool.html

  7. Hi James,

    I’ve had Blue Harvest for over a year now and it’s worked a treat to get rid of all those horrible resource forks from our servers.

    However, today it caused me some problems. We’ve been setting up SVN projects and my mac was corrupting them! It turns out (we think) that because Blue Harvest was setup to “Treat UNIX invisible files as resource forks” that the .svn files were being removed as I opened my PHP IDE.

    I’ve turned off the setting now and (fingers-crossed) they’ll be no more problems. I just thought I would post a comment, just in case anyone else suffers any similar issues through mis-configuration.

    Cheers

  8. Robert says:

    Disclosure: I’m not a mac fan-atic. No patience for FOSS or WinTel fanbois either.

    While I appreciate the sharing of information, none of this treats the problem – only the symptom.

    The problem is that Apple has chosen to take the lazy man’s way out by implementing a clumsy kludge, rather than fixing the existing architecture.

    The data in these helper files should either be stored on the client, or not exist at all.

    Writing to a network drive is NOT a requirement for reading files, and writing an OS that behaves this way by default is just plain irresponsible.

    And, no. I’m not going to run around to every mac to either run commands, or to install an app to suppress finder turds.

    What would be really useful would be a method to embed apple script in a windows domain login script to disable the behavior on logon.

    Until I can dope that out, I’m just turning off write access to smb shares for our mac users. They can learn to use ftp instead.

  9. creat_ing says:

    Great post! thx very much!

  10. taufgeschenk says:

    Thanks for this guide for the removal of the .DS_Store files.Now the network works more smoothly.

  11. I have installed Blue Harvest and i don’t find ccleaner files in that. I don’t know anything in mac pc so what should i do?

  12. Working Stiff says:

    It’s my Windows friends that question the .DS_Store files and I don’t blame them. But if my OSX needs them why should I delete them?
    If there was a simple way to send email attachments without the .DS_Store file I’d like to know about it.
    But I agree w prev. poster that the problem shouldn’t exist in the first place and that blame is on Apple’s OSX.

  13. MacPro says:

    Good luck in not rendering your mac fonts useless!! You really haven’t done your homework, neither did anybody else responding to you so far.
    Another minefield: Type/Creator data stored in the HFS tree. Apple discontinued support for those in 10.6. Yet the software industry was supposed to be using the MIME based UTI. Nothing happened. Result: Chaos, at least as far as creative design and production is concerned working with multi-flavour EPS and other legacy – such as PS Type 1 fonts.

    If one then throws IT guys like yourselves in the mix, the chaos is amplified!!!! Stick to Windows or run Windows on Macs. In the end you only want a nice looking computer, which the Windows world hasn’t provided to date.

*
To prove that you're not a bot, enter this code
Anti-Spam Image