dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Setting to disable .DS_Store creation on network drives is broken

Open elyscape opened this issue 8 years ago • 7 comments

The setting in .osx to disable .DS_Store file creation on network drives doesn't work correctly. The line reads:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

Unfortunately, as per the Apple knowledge base, the correct command is:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

I tested it out on my machine and this actually does prevent it from working correctly. Which is frustrating!

elyscape avatar Mar 12 '16 06:03 elyscape

This article has been archived and is no longer updated by Apple.

Apple hates us

Tatsh avatar Mar 12 '16 13:03 Tatsh

-bool true and just true are equivalent.

mathiasbynens avatar Mar 14 '16 09:03 mathiasbynens

Unfortunately, that is not the case:

scapeless:~ elyscape$ defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
scapeless:~ elyscape$ defaults read com.apple.desktopservices DSDontWriteNetworkStores
1
scapeless:~ elyscape$ defaults read-type com.apple.desktopservices DSDontWriteNetworkStores
Type is boolean
scapeless:~ elyscape$ defaults write com.apple.desktopservices DSDontWriteNetworkStores true
scapeless:~ elyscape$ defaults read com.apple.desktopservices DSDontWriteNetworkStores
true
scapeless:~ elyscape$ defaults read-type com.apple.desktopservices DSDontWriteNetworkStores
Type is string

That is to say, true gets written as a string. That seems less useful than the actual boolean value that -bool true writes. Unfortunately, -bool true straight up does not work on OS X 10.11, whereas string true does. While I don't have any earlier systems to test on, it seems unlikely that Apple would have changed the check from a boolean to a string, and the documentation stating to set it as a string value has existed since OS X 10.4, so it seems to me that they initially did a string comparison and then just never bothered to change it.

elyscape avatar Mar 14 '16 15:03 elyscape

On my 10.12.6 neither of "true" or "-bool true" have any effect. So frustrating!..

ghost avatar May 07 '18 23:05 ghost

The official documentation claims that -bool TRUE should work with 10.13. That being said, @VladAtOple: did you make sure to log out and log back in after changing the value?

elyscape avatar May 07 '18 23:05 elyscape

This page suggests to try with -string true:

defaults write /Library/Preferences/com.apple.desktopservices DSDontWriteNetworkStores -string true

nmrshll avatar Dec 05 '19 10:12 nmrshll

I have the same problem and I have tested everithing:

  • bool, string, nothing, etc
  • local user, system level, etc This didn't happen on the Intel MackbookPro, just on the M1 MackbookPro

rodrigoalvarez avatar Jan 23 '22 08:01 rodrigoalvarez