Thursday, June 28, 2012

Update: Removing those darn .DS_Store and .AppleDouble directories from shared network storage

Seems at 0200 in the morning I was not accurate in my description.  I apologize.


This one is a short one. 


I searched long and hard for this one and found a partial fix.  The environment variables of old (Leopard and Tiger) do not work to stop the creation of these files. I found out the hard way. :-)


.DS_Store

Here is the command to stop the creation of .DS_Store Directories that pollute your network storage resources. For For Mac OS X Lion you need to use:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Now you must Logoff or Restart.


.AppleDouble

To stop the creation of .AppleDouble folders you need to edit your AFP service configuration.  There is usually a "No AppleDouble" or "Enable AppleDouble" configuration setting that needs to be set true (For the NO option) or set to false (For the Enable Option).


Note: In FreeNAS 8.0.4 it seems that the .AppleDouble directories are created anyway regardless of setting.  But at least they seem to be empty and can be removed (rm -r /path/).




The Who, What, and When

The .AppleDouble Directories are used by Mac OS X to store Extended Attributes (exattr) for files residing on filesystems that are not formatted HFS+.  They are most commonly seen when moving a flash drive from your Mac to your Windows Machine.


The .DS_Store Directories store Finder Information.  Such as in "Get File Information" you can access a "Comments" field.  If you provide information on the file i the comment it is stored and Finder Information.  If this directory is missing on remote storage, other Mac users would not be able to see the comment you created.


Why get rid of them?

On network storage you can have the same share presented over AFP (Apple Filing Protocol) and CIFS (Common Internet File System).  Windows users that connect over CIFS can see the extra Apple directories.  The files often copy the name of the original file and prefix it with "._".  Windows users can mistakenly access these files and think their data is corrupt.


Hope this helps, :-)


This is the day the Lord has made. We will rejoice and be glad in it.
  --Psalm 118:24, NLT

1 comment:

  1. Just found this, it might be what you're really looking for: http://blog.graceabundant.com/2011/10/02/freenas-simultaneous-afpcifs-shares-done-neatly/

    At least, it was exactly what I needed.

    ReplyDelete