New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/config, lib/fs: Make junction behaviour configurable (ref #6606) #6907
Conversation
9bdd57f
to
41825ad
Compare
I think we do a config migration of this, setting to true on all existing folders, and defaulting to false. |
Passing fs options as url-like query parameters might not be the best idea: A filesystem path does not necessarily conform to what |
I don't mind options, I mind functions thrown around like they are variables, yet I think query string stuff is the right way to go here. |
Well these options are functions disguised as options ;) Anyway my problem is that almost anything is allowed in paths, i.e. you need to do parsing yourself ( |
so my original idea was to turn C:\foo\bar into file://c/foo/bar, but it never happened. If it did happen, this would be much easier. This also would have allowed getting rid fo the type, as the schema dictates the type. |
That makes sense, but being an unrelated change and quite possible to turn up weird cornercases, I used options, It's still easy enough to switch to "all uri initialisation" from here. |
lib/fs/basicfs.go
Outdated
@@ -23,13 +23,20 @@ var ( | |||
ErrNotRelative = errors.New("not a relative path") | |||
) | |||
|
|||
func WithJunctionsAsDirs() Option { | |||
return func(fs Filesystem) { | |||
fs.(*BasicFilesystem).junctionsAsDirs = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panic if I ask for a fakefs with junctionsAsDirs?
See https://forum.syncthing.net/t/option-to-follow-directory-junctions-symbolic-links/14750/126 and following.