5

As a developer, I'm routinely making folders on my Mac running Mojave for testing purposes, my localhost server or for transfer to VPS or other hosting. In principal I'd rather not have .DS_Store altogether, but if the computer wants to have them, I don't mind.

However, is there a way to permanently stop them from being created in a particular dir and subdirs?

I'm aware you can configure no .DS_Store files across the board on network shares, but I need to be more selective than an all or none solution. Ideally I can suppress these both on local filesystems as well as remote, but if anyone can help with preventing some of these and allowing others, I would be grateful.

This question is to address Mojave and newer OS only and to address a more fine grained control or to confirm that this is impossible.

4

There's no built-in functionality in macOS to stop the creation of .DS_Store files in a specific folder and its subfolders. There's a setting to stop the creation on networked volumes (i.e. folders that really are network shares).

You can download a third party utility called "DeathToDSStore" from here:

https://github.com/snielsen/DeathToDSStore

This will stop the generation of .DS_Store files in general, but still not for a specific directory.

You mention that you are a developer - thus it might be possible for you to modify that utility to do exactly what you want. The utility is open source. You can find the specific place to override in the file source/FinderOverride.m.

In the comments you've mentioned needing to run on Mojave, which DeathToDSStore doesn't support yet. On Mojave you can run this fork of Asepsis that is compatible with Mojave:

https://github.com/JK3Y/asepsis

  • I found that this utility isn't working on Mojave and I'm a web developer thanks – Danny F Oct 25 '18 at 9:30
  • 1
    I have added a link for a Mojave compatible software package – jksoegaard Oct 25 '18 at 11:33
  • +1 for JK3Y/asepsis, that did the trick for me! – Lindsey D Jan 31 at 7:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .