When you copy files to a network drive or USB drive, Apple places a series of invisible files that are sometimes only a problem for users of the same storage device on other operating systems or devices such as TVs or media players because they are visible to them.
macOS High Sierra: Remove the creation of .DS_Store and Resource Forks files on external network and USB disks
Finally, you end up with a network disk or a USB disk full of small files per folder and per file. If those disks are only used by you or by people who only use MAC, that’s not too much of a problem, but if the.DS_Store or AppleDouble files are really a problem, we’ll disable their creation.
But first, let’s take a look at what these files are so you know what they do and what happens if you delete them.
These types of files are created and managed by the Finder to store custom attributes of a folder such as the position of icons, the custom background of the window and, in general, any specific customization made to the window of that folder. If you delete them, all that customization you’ve made to that folder’s window disappears. Also, from Mac OS X 10.4 Tiger onwards, these files contain Spotlight comments for the folder.
The Resource Forks files
I’m going to try to explain this to humans because the explanations on the Internet about this type of file are generally very technical and very complex.
When we work with our files on the Mac, we add a number of metadata to our files such as tags, Spotlight comments, custom icons for images, and more. These files are innate to the system and are simply not created or displayed for the file system we use on our hard drives. But when we copy our files to a file system that does not support this data, such as FAT. For example, Resource Forks files are created so that when you insert that disk on another Mac. Also, the additional metadata that has been added to the file is respected.
That’s why, for example, when you copy a movie to a FAT flash drive and then put that flash drive on the TV, you get those files that have the same name as the movie and are not playable (Resource Forks), but with a dot in front of them so they don’t show up in OS X and on systems that interpret files with a starting point in the name as invisible, but are seen in others. The same goes for network drives and other types of storage drives.
How do we remove the creation of these files?
We can force the system not to create such files on network volumes or USB disks using the Terminal, under Applications > Utilities.
The two commands are:
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
For storage volumes in Network (servers, NAS, etc) and
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
For USB storage units (USB drives, hard drives, cards, etc.)
Remember that you can change
falseto reverse this behaviour.