Starting with macOS Sierra (10.12), Apple has taken extra steps to hide the presence of .DS_Store
files; i.e. since 10.12 they can not be seen as hidden files... they simply cannot be seen at all in Finder
. I do not know why, except that this tactic seems to fit in with Apple's generally secretive MO. There has been much speculation and investigation into the details and content of the .DS_Store
file, but AFAIK no one has completely "cracked the code" on this file.
I have presumed innocence wrt Apple's creation and long-term use of the .DS_Store
file. I've made this assumption in ignorance of the file's function/purpose, but I do wish they would disclose their reasoning. That said, I agree that Apple's intemperate dispersion of DS_Store
files is a bad thing as it may cause malfunctions in software/systems performing necessary or desirable functions.
In this "support" document Apple implies they have provided a method to limit the intemperate dispersion of .DS_Store
files from their OS. Unfortunately for users, this document is deceptively worded. Note that the command Apple recommends in this document contains the term DSDontWriteNetworkStores
. If that command is taken at face value, it certainly implies that this command stops Apple's OS from Writing .DS_Store
files. But in the preceding paragraph Apple writes, "you can prevent macOS from reading .DS_Store files"! Apple, disingenuously, never admits that we users cannot prevent macOS from writing .DS_Store
files. Very slick piece of writing... very deceptive - cowardly even!
Apple's "support" document contains further ambiguities and deception. It says "for browsing network folders such as Server Message Block (SMB) shares
". No mention is made of other network file systems; e.g. NFS or SSHFS. I have not tested these other network file systems here as Synology uses SMB by default. And speaking of testing, results of my testing of the Apple Solution for .DS_Store
follows:
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
Test the Command:
Since Apple doesn't actually tell us much, we should verify the setting. After the write
above, let's now do a read
:
defaults read com.apple.desktopservices DSDontWriteNetworkStores
1
Huh - 1
... I wondered what that meant in "Apple-speak", so went a bit further to verify:
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool FALSE
defaults read com.apple.desktopservices DSDontWriteNetworkStores
0
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
defaults read com.apple.desktopservices DSDontWriteNetworkStores
1
So - Apparently TRUE == 1, and FALSE == 0
Now, just for grins we'll try this with a different user - a member of the Administrator group:
seamus@fumier ~ % su sdemora
Password:
sdemora@fumier ~ % defaults read com.apple.desktopservices DSDontWriteNetworkStores
2024-03-23 21:21:24.357 defaults[33484:4740417]
The domain/default pair of (com.apple.desktopservices, DSDontWriteNetworkStores) does not exist
# surprising! but apparently the default value does not exist until it is written!
sdemora@fumier ~ % defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
sdemora@fumier ~ % defaults read com.apple.desktopservices DSDontWriteNetworkStores
1
And so, in conclusion we see that the command syntax works as claimed. But let's see if the command actually stops distribution of the .DS_Store
files.
Does Apple's Command Actually Limit Writing .DS_Store
Files?
I have set up a small demonstration using rsync
on a Synology NAS (DSM ver 7.2-64570 Update 3). The demonstration involves a small folder with 2 subfolders, and a dozen files on the local drive of my Mac (aka fumier). These local files are the SOURCE in this rsync
demo. I rsync
these local files/folders to the rsync daemon
running on the Synology NAS; this copies the files to Synology's file system. The Synology server's filesystem is the DESTINATION in this demo.
IOW, this is a very typical (but simplified) configuration for backing up one's local drive to a network file system using rsync
.
Following is the script I run on my Mac to perform the actual rsync
backup:
#!/opt/local/bin/bash
PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
cd '/Users/jmoore/scripts/rsync-bkup'
SRC_Demo='/Users/seamus/RsyncDemo/'
DST_Demo='rsync://seamus@SynologyNAS-1/backups/fumier/Rsync_Demo'
rsync -rlAtgoDiv --password-file=./pwd-f $SRC_Demo $DST_Demo
exit 0
After running the script above, following is the Finder view of the rsync'd
files on the SynologyNAS:
Now for the moment of truth... did Apple's defaults
command prevent the propogation of .DS_Store
files from the Mac to the NAS? Since we can't actually see .DS_Store
files in Finder, we'll need to use something else - the find
command will work for this:
seamus@fumier /Volumes/backups/fumier % find . -name '.DS_Store' -print
./Rsync_Demo/.DS_Store
./Rsync_Demo/RsyncDemoA/folderA/folderA-1/.DS_Store
./Rsync_Demo/RsyncDemoA/folderA/folderA-2/.DS_Store
./Rsync_Demo/RsyncDemoA/folderA/.DS_Store
./Rsync_Demo/RsyncDemoA/.DS_Store
./Rsync_Demo/RsyncDemoB/folderB/folderB-1/.DS_Store
./Rsync_Demo/RsyncDemoB/folderB/folderB-2/.DS_Store
./Rsync_Demo/RsyncDemoB/folderB/.DS_Store
./Rsync_Demo/RsyncDemoB/.DS_Store
What we see above is proof positive that Apple's DSDontWriteNetworkStores
command did not inhibit the propagation of .DS_Store
files from the Mac to the Synology file server.
The Verdict:
Apple's defaults
command did not prevent the propagation of .DS_Store
files
This is fairly disappointing - even considering that "it's Apple". But of course you're free to draw your own conclusions regarding Apple's intentions here. Following are a few other points to ponder:
- Perhaps Apple considers this to be a "non-covered" form of network connection?
- If you actually read Apple's announcement, you may note the following statement: "you can prevent macOS from reading .DS_Store files on SMB shares". Odd that - naming a command to prevent reading as "DSDontWriteNetworkStores"!?
- As it turns out, Apple's online instructions for limiting the spew of
.DS_Store
have been circulating for more than 10 years, discussed in reputable forums, including hundreds of Q&A here on SE. The fact that Apple re-published it on Feb 29 of 2024 is puzzling, but not surprising in its arrogance.
- Or... perhaps I overlooked something? If so - please let me hear from you!