Prevent MacOS from making .* and ._* files

11

7

Whenever I plug someone's FAT32 flash drive into my computer, MacOS loves to add all sorts of hidden files.

A couple of these include:
.Spotlight-V100/
.Trashes/
.fseventsd/
.DS_Store

When they get the drive back, they see all this cruft. How can I prevent this from happening?

Thanks!

macek

Posted 2010-02-05T16:38:51.183

Reputation: 5 157

Answers

2

I don't know if saying "here's an app" is an OK solution to a problem, but I did some digging and found this:
http://www.zeroonetwenty.com/blueharvest/

Might be worth taking a look at but might not be worth $16.95...

EDIT:

I'm using BlueHarvest trial and seems to work very well. Because it provides the most complete solution for the original question, I'm marking this as the accepted answer.

macek

Posted 2010-02-05T16:38:51.183

Reputation: 5 157

7

These files and directories are created by various applications:

.DS_Store - Created by Finder when you open a directory. It stores information about the folder (view options, icon positions, etc).

.fseventsd - created by the fseventsd daemon. It contains data about file system events such as modifications, deletion, creation, etc.

.Spotlight-V100 - stores indexing information for spotlight in the form of metadata.

.Trashes - A folder containing files that have been sent to trash but not yet deleted from the volume.

In order to prevent them all from being created, you have to modify the behaviour of each application individually. That would include adding an exception to Spotlight, Disabling Finder's caching feature (if possible), changing the fseventsd daemon and so on. I'm not sure if it's even possible to add exclusions or disable all of these features. If you don't need to write to the disk, I'd just mount it as read only to make things easier.

John T

Posted 2010-02-05T16:38:51.183

Reputation: 149 037

Is there anything you don't know?! I need read/write access to the drive but I'm guessing MacOS doesn't have ability to add simple exceptions. Sounds like I might need an app for this-- if it's out there... ps. thanks (yet again) for the help. – macek – 2010-02-05T16:48:45.467

Maybe it would be easier to mount as read only then copy the entire drive to your disk for modifications? I'm not sure exactly what you're doing but it might be a suitable solution. Regardless, you're more than welcome :) – John T – 2010-02-05T16:51:33.243

This answer provides details as to how it might be possible to fix the problem, but I'm not going to mark this as accepted because it does not actually provide a solution. Still an up-vote, though! Thanks for the info, John :) – macek – 2010-02-09T19:23:33.930

4

Leopard & Snow Leopard make these files hidden. Mac OS X can be told not to put these files on network drives using:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

valbaca

Posted 2010-02-05T16:38:51.183

Reputation: 404

Are USB drives considered "network drives"? – macek – 2010-02-05T16:51:58.860

I think this only prevents .DS_Store creation, but this is the right way to add an exception for that. – John T – 2010-02-05T16:52:29.357

I tried doing this and it only prevents .DS_Store – macek – 2010-02-05T18:22:01.140

This doesn't seem to apply to normal USB drives at least on Lion. – Lri – 2012-02-13T10:15:21.363

2

There are two approaches.

One works on one machine for all flash drives, and stops the various services from writing to the drive. It's fairly complex, so I'll let thexlab explain it themselves at http://www.thexlab.com/faqs/stopspotlightindex.html

The other fixes one flash drive so you can poke into Macs and not have them index it. You have to put a few files on the flash drive BEFORE you plug it into a Mac, that tell the OS not to write various things. More info at http://hostilefork.com/2009/12/02/trashes-fseventsd-and-spotlight-v100/

between the two of them, they seem to have it covered. No, it's not perfect - if you carry a stick around and stick it into Macs, it HAS to have at least those few useless files on it. Oh, well.

Chainsaw

Posted 2010-02-05T16:38:51.183

Reputation: 21

1

Well, there's also this and it's free, u might want to throw a folder called autorun.inf too for security in windows

http://hostilefork.com/2009/12/02/trashes-fseventsd-and-spotlight-v100/

Gustav Xyrer

Posted 2010-02-05T16:38:51.183

Reputation: 11