Is there any way to prevent a Mac from creating dot underscore files?

Have your Mac user install BlueHarvest.

Blue Harvest


On Linux file servers or NAS devices you can use the following:

Option A. Samba configuration modification preventing both resource shares and .DS_Store files:

veto files = /._*/.DS_Store/

delete veto files = yes

(Configuration file located at /etc/samba/smb.conf or /etc/smb.conf depending on your distribution) Disadvantages: not all shares are provided by Linux-driven NAS systems, or on most you don't have shell access.

Option B. Create a simple shell script and run it from one of your connected machines using cron.

find /YourNetworkShareLocation -name '._*' -exec rm {} \;

Replace /YourNetworkShareLocation with where your network share is mounted, e.g. /Volumes/ShareName or /media/ShareName, etc.

Disadvantages: this is the brute's way - unnecessary load on both storage and network. However, the same can be easily done in Windows using a little PowerShell magic.

Disclaimer: This is not what I call "a solution", it's a hack. But it could help someone reduce the annoyance levels delivered by resource fork files.


Have him look into the free and aptly-named Cleanup SMB Mess application. The developer says:

This applescript droplet will clean up Windows shares mounted through the Mac OS X samba client, by removing all "._*" files, .DS_Store files and .Trashes folders on all the volumes and folders dragged on it."

I've only used with thumb drives and MP3 players, and it does what it says it does. I'm guessing it has to scan the device to remove the garbage, and that may be cumbersome on a large network share. But that's only speculation on my part. I'd suggest asking the developer.