.stignore on Windows - spaces in folder names and backslashes

Hey, guys! I have a couple of questions about the ignore file.

  1. I’m syncing my entire partition, so both “$RECYCLE.BIN” and “System Volume Information” get synced. To ignore them, I have to enter them in the .stignore file - are there any special rules for entering folder names with special characters (e.g. “$”) and folder names with spaces in them?

  2. Which backslash should I use on Windows - \ or / ?

An example would be great. Thank you!


I haven’t written the ignore part, so it’s just my assumptions:

  1. I think it does a regex based comparison, so no need to escape spaces, but you might have to escape $ as \$, at least if you are not on Windows. We currently only escape *, ., ? for you. Though to be honest, try and see, I am not sure how Go’s regex parser deals with ending anchor in the middle of the pattern.
  2. I think either will work on Windows, but you should probably use /
1 Like

I’ve tried escaping the $ character, but it didn’t work out. So now, my .stignore looks like this:

*RECYCLE.BIN /System Volume Information

I realize that if I have another file or folder named “RECYCLE.BIN” it will not get synced, but I’ll try not to over use this string in file and folder names :smile:

Thanks for the assistance!

Try double backticks \\ (though I am somehow sure it will not work).

Just tried, but you are right, doesn’t work. It’s a minor issue, especially considering how great SyncThing is. Maybe it should be filed in the bug tracker, but I’m not sure how to do it myself.