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

Solution 1:

Have your Mac user install BlueHarvest.

Blue Harvest

Solution 2:

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.

Solution 3:

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.

Solution 4:

Use a program other than Finder such as MuCommander to browse your files. (works on Local drives too).

In OS X lion, this method should allow default access to ~/Library without modifying settings or hitting ALT as well.

I use MuCommander on Snow Leopard and Lion and noticed that neither HFS+ or ExtFat volumes end up littered with files with these files.

Folks: there is another issue, File size... many of the resource forks at are least 4096 bytes even when the original file is under 4096 bytes so eliminating this problem does help with File System Bloat.

(For example: Download the Text file: http://www.gamers.org/pub/games/idgames/levels/heretic/g-i/horror.txt on a Mac and see for yourself)

Solution 5:

You could also use a Mac app in the app store called 'Annoying File Be-Gone' that runs on the menubar and works well.