docs icon indicating copy to clipboard operation
docs copied to clipboard

stignore path seperator on windows

Open jtagcat opened this issue 3 years ago • 4 comments

https://docs.syncthing.net/users/ignoring.html

Escaped characters are not supported on Windows, where \ is the path separator.

I did some testing, essentially on windows alias "\"="/", mixing both acts as if you used / on *nix

jtagcat avatar Mar 06 '22 17:03 jtagcat

  • Both / and \ is used as a path separator on Windows.
  • A pattern beginning with / → (path separator) (may be \ or /)

Additional digging in source code should give some exact answers.

jtagcat avatar Mar 06 '22 17:03 jtagcat

I'm not sure if this is a question or a request of some sort? On Windows, often in general and in Syncthing in particular, both slash and backslash are valid path separators. c:/some/folder is a valid path as far as Syncthing is concerned.

calmh avatar Mar 06 '22 20:03 calmh

More like a todo, that C:/hello\world/owo\foo/bar is all good and well, yea

jtagcat avatar Mar 07 '22 08:03 jtagcat

I'd assert that not everyone knows what a "directory separator" is, so on "users/ignoring.html", just before it mentions "directory separator" might be a good place to put in a sentence or two saying that / is the "directory separator", and that it works on Windows the same as other OSs. Maybe add that the usual Windows separator \ works too, but only on Windows (if that is the case)?

The example of .stignore on that page has wildcards and shows how they affect files that happen to be in subdirectories. It might be helpful to include (more) fully qualified paths (if they work) instead of relying only on wildcards? So, maybe

./logs/*

if it does in fact ignore files in a logs subdirectory just below the current root? Or if wildcards are in fact the only way to affect files in subdirectories, maybe include a few more examples of how one might do that without accidentally ignoring files in the root or other subdirectories.

rodrymbo avatar Apr 23 '22 16:04 rodrymbo