docs icon indicating copy to clipboard operation
docs copied to clipboard

Brackets [] are actually allowed in file names on Windows

Open walteweiss opened this issue 5 years ago • 3 comments

On Windows, escaping special characters is not supported as the \ character is used as a path separator. On the other hand, special characters such as [ and ? are not allowed in file names on Windows.

From the documentation: How can I exclude files with brackets ([]) in the name?

While it’s true to the ? question mark symbol, it’s not true to the brackets [], here’s the proof, and anyone can check that on Windows.

Brackets do work on Windows in the filenames.

It’s a minor mistake, but it’s confusing.

walteweiss avatar Jan 15 '20 15:01 walteweiss

Excuse me if this should be handled differently, maybe I can help reformulate this, but I have found only open an issue or fork the project.

walteweiss avatar Jan 15 '20 15:01 walteweiss

No this is fine, just need to come up with a more correct phrasing of that faq item. I wonder if, for example, a left bracket can in fact be matched by putting it inside brackets ([[]) or if that's a syntax error to the parser. Otherwise it's just ? to match such characters.

calmh avatar Jan 16 '20 06:01 calmh

phrasing of that faq item. I wonder if, for example, a left bracket can in fact be matched by putting it inside brackets ([[]) or if that's a syntax error to the parser. Otherwise it's just ? to match such characters.

I just noticed the same glitch reading documentation. I get that this needs a deeper rewording but let's not wait another 5 months can you change this now to

On the other hand, special characters such as ? are not allowed in file names on Windows.

and commit as an interim fix until it is fully addressed?

Perhaps there is some confusion between glob and regular expressions. I am not a Syncthing developer - escaping glob characters is it part of glob library function or is it a chunk of Syncthing code mimicking what a command shell normally handles ??

TekBear avatar Jun 22 '20 17:06 TekBear