I totally hate to see those .dsstore and resource files on my Windows disks.

Is there a free program that will autodelete those files on specified disks on logout/eject?

  • .dsstore and resource files aren't in the same category. For some files, deleting the resource fork will result in substantial data loss. – Daniel Sep 27 '11 at 20:18
  • for me are in the same category: litter. Of course I won't move system files on a windows disk (why I should), so I think it's 100% safe to delete them. – Magnetic_dud Sep 27 '11 at 23:24

There are many ways to remove .DS_Store files; it really depends on what your exact needs are for the method you decide to use. To automatically remove them when you login/logout would be quite different from ejecting a disk, since it's a completely different process. You can disallow .DS_store for from being allowed to write to network disks, etc. by opening up Terminal and entering:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

to manually remove already present .DS_Store files you can use:

dot_clean /path/folder

which merges any such files with the parent file.

| improve this answer | |
  • it's possible to run this command at the logout? – Magnetic_dud Sep 27 '11 at 23:26
  • 3
    It's possible to run commands (in the form of a shell script) at logout using what Apple calls a LogoutHook, but the exact method varies depending on the exact version of OS X you're running. Here is the general method I've used in the past. The Secrets pref pane from Blacktree also has an option for specifying a LogoutHook script. – calum_b Sep 27 '11 at 23:57
  • @scottishwildcat — awesome explanation and tips! ;-) – l'L'l Sep 28 '11 at 0:09

Resource forks don't exist as actual forks anymore. They have been stored as extended attributes since 10.4.

The files that start with ._ are used to store extended attributes, ACLs, and HFS file attributes / Finder flags. They can be deleted with dot_clean or find:

dot_clean /Volumes/Volume
find /Volumes/Volume -name ._\* -delete

.DS_Store files can be deleted with find:

find /Volumes/Volume -name .DS_Store -delete

Another option is to use BlueHarvest:

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .