Syncthing not removing empty directories

I don’t have the correct parameter set apparently for Syncthing to remove empty directories on clients after they have been moved or deleted on the server.

It is probably simple, but I don’t understand the correct use of (?d) in stignore, which is possibly the problem.

thanks, jts

Syncthing does remove empty directories without any problems, but this question seems to be more about directories that contain ignored files. The (?d) switch is useful in a situation, where you (re)move a folder on a remote device, and then that change is synced to your local device. Without (?d), the folder won’t be deleted locally even if it contains only ignored files. With (?d), however, if everything inside it is covered by your ignore patterns, then the folder will be deleted locally too.

If the above is unclear, please provide some concrete examples (with screenshots, if possible) that would show us more clearly the specific problem that you’re facing.

1 Like

Same problem was in my case, I solve it with entrances in the .stignore e.g.

  • pattern beginning with a (?i) prefix enables case-insensitive pattern matching
  • pattern beginning with a (?d) prefix enables removal of these files if they are preventing directory deletion

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.