Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macstatic

macrumors 68020
Original poster
Oct 21, 2005
2,024
164
Norway
What's the best way to prevent MacOS from writing DS_store files on memory cards and USB flash drives?
I often use them with non Mac systems (i.e. MSDOS) for cross-platform file transferring.

I know about the drag & drop tools such as HiM, but they don't always work reliably and it's a pain if you forget to do it and unmount the memory card/flash drive the usual Mac way instead.
I also know there's a way to prevent DS_store files from being created on network drives, but this doesn't seem to help my particular situation.

Another challenge comes to mind: some USB flash drives are Mac partitioned and meant for Mac files, so those should not have these files removed, but other flash drives (i.e. MSDOS partitioned) should. I've heard about BlueHarvest -will this solve all my problems and distinguish between Mac and non-Mac USB flash drives/memory cards?
 

Slartibart

macrumors 68040
Aug 19, 2020
3,145
2,819
It might depends on the MacOS/X version your system is on. You can check

~/Library/Preferences/com.apple.finder.plist

about possible options (that’s a plain xml file) and then, to read/write .plist files, use the defaults command.
To be clear: I do not know wether there is an appropriate option there, it’s just where I would start. ?
 

Darth.Titan

macrumors 68030
Oct 31, 2007
2,906
753
Austin, TX
There's not a way to prevent creation of .DS_Store files when writing to FAT volumes.

There are a few apps that will remove those files after they're created, but no way to stop MacOS from creating them.
 

hobowankenobi

macrumors 68020
Aug 27, 2015
2,125
935
on the land line mr. smith.
Tinkertool has a GUI to prevent .DS_store creation on network drives, probably won't work on local mounts. Likely just the same command you linked to.

To be clear, outside of the visual noise, no need to worry about .DS_store files. Safe to ignore or delete.
 
Last edited:

macstatic

macrumors 68020
Original poster
Oct 21, 2005
2,024
164
Norway
Yes, I know those files generally cause no harm, but when they're found inside just about all folders and sub-folders of what I transfer to another computer (non-Mac) they're very irritating (and often impossible to delete there as well).

I had a closer look at BlueHarvest and currently use it in trial mode.
Looks like a useful tool, but I'm a litle confused about how it works though: if it cleans out those Mac-related files automatically (and if that's done at regular intervals or immediately as they're created, or when you eject the memory card/flash drive) or if you always have to remember to go to the menu bar icon and click the "clean" button -perhaps someone else knows?
The more I can forget about doing this manually the better!

PS: I found out that you can define specific storage devices by name, so that's good if I can just name a certain flash drive and have it cleaned out automatically.

PS 2: has anyone heard about/used CleanMyDrive2? From what I've read in other threads it's similar to BlueHarvest, but someone called it "Malware" since it was impossible to uninstall or see as running process (?!!?) Not sure what to think about it and would rather not install it before I know more.
 
Last edited:

Boyd01

Moderator
Staff member
Feb 21, 2012
7,952
4,888
New Jersey Pine Barrens
This little program was developed specifically to prevent that problem with GPSes and SD cards, but it might do what you want (it's free). The author has created a number of excellent java-based free tools but unfortunately has ceased development due to serious health issues.

 
  • Like
Reactions: mr.steevo and grad

macstatic

macrumors 68020
Original poster
Oct 21, 2005
2,024
164
Norway
Thanks, but this still relies on user-interaction, right?
I'm hoping for something that, once configured, just keeps my (non-Mac) memory cards/USB flash drives "clean".
 

posguy99

macrumors 68020
Nov 3, 2004
2,284
1,531
This little program was developed specifically to prevent that problem with GPSes and SD cards, but it might do what you want (it's free). The author has created a number of excellent java-based free tools but unfortunately has ceased development due to serious health issues.

"Excellent" and "java" in the same sentence? The mind boggles.
 

Boyd01

Moderator
Staff member
Feb 21, 2012
7,952
4,888
New Jersey Pine Barrens
The OP said he did not want to drag/drop anything, he wants something automatic. From the docs of the free program I mentioned above:

"drag and drop the disks you want to eject onto the icon of CleanEject; they will be cleaned and ejected without showing a dialog box."
 

Slartibart

macrumors 68040
Aug 19, 2020
3,145
2,819
The OP said he did not want to drag/drop anything, he wants something automatic. From the docs of the free program I mentioned above:

"drag and drop the disks you want to eject onto the icon of CleanEject; they will be cleaned and ejected without showing a dialog box."
None of the solutions mentioned so far is “automatic” then. Due to a potential lack of a setting in the Finder or somewhere else, a shell script wrapped in a droplet or mapped on a keyboard short cut seems the easiest&fastest to implement solution to me... and it’s pretty automatic. ?
I admit that’s just me - of course you can come up with something slightly more elaborated which is called every time there is a write access to any external device, I suppose that’s your definition of automatic ?
In the end you have to make sure that just before you unmount an external device all undesired data is deleted and from where I stand it is absolutely fine to support some developer who put their brains into implementing something or just type

cd /Volumes/WhateverYourExternalMountedDeviceIs/IfNeededTypeTheSubfolderHere
rm ._*


into the terminal or/and automate it with Automator or Platypus&Co. It’s all automatic. ??
 

HDFan

Contributor
Jun 30, 2007
7,298
3,346
Carbon Copy cloner has a filter option to exclude copying specified files.
 

Boyd01

Moderator
Staff member
Feb 21, 2012
7,952
4,888
New Jersey Pine Barrens
Lots of ways to avoid with sync tools...but most are not drag and drop, which OP is looking for if I understood correctly.
I think you misunderstood. :) He wants something that automatically removes the files whenever they are created without any actions from himself. Several drag and drop solutions have already been suggested.

Thanks, but this still relies on user-interaction, right?
I'm hoping for something that, once configured, just keeps my (non-Mac) memory cards/USB flash drives "clean".
 

macstatic

macrumors 68020
Original poster
Oct 21, 2005
2,024
164
Norway
I think you misunderstood. :) He wants something that automatically removes the files whenever they are created without any actions from himself. Several drag and drop solutions have already been suggested.

I'm the OP and you're correct.
In a busy settings it's easy to forget that you need to "eject" a particular drive to a specific "cleaning app" in the dock instead of dragging it to the trash can. I prefer not to settle "exceptions to the rule" solutions such as that. I have plenty of other tasks on the Mac where I have to keep this and that in mind, so the list is getting longer all the time.

BlueHarvest appears to do what I want though. The documentation was a little unclear on the above, but so far I haven't had any stray "Mac specific" files on my MSDOS memory cards, so something must be working ;)
All I do is eject the memory cards the usual way (drag them to the MacOS trashcan), so BlueHarvest is apparently working in the background.

Unless someone knows better I think I'm going to buy a license for it (US$ 14.95)
 
Last edited:

mr.steevo

macrumors 65816
Jul 21, 2004
1,411
942
This little program was developed specifically to prevent that problem with GPSes and SD cards, but it might do what you want (it's free). The author has created a number of excellent java-based free tools but unfortunately has ceased development due to serious health issues.

I had an issue with playing mp3's via a USB stick through an older car stereo. Every second "track" was unsupported and was essentially a ghost gap of 7 seconds between songs.
Clean Eject solved it.

Thank you, Boyd01
 
  • Like
Reactions: Boyd01
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.