forked from TrueCloudLab/rclone
local: add --local-case-sensitive and --local-case-insensitive
This is to force the remote to declare itself as case sensitive or insensitive where the defaults for the operating system are wrong. See: https://forum.rclone.org/t/duplicate-object-found-in-source-ignoring-dedupe-not-finding-anything/10465
This commit is contained in:
parent
4549305fec
commit
628530362a
1 changed files with 26 additions and 0 deletions
|
@ -96,6 +96,24 @@ check can be disabled with this flag.`,
|
||||||
NoPrefix: true,
|
NoPrefix: true,
|
||||||
ShortOpt: "x",
|
ShortOpt: "x",
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
|
}, {
|
||||||
|
Name: "case_sensitive",
|
||||||
|
Help: `Force the filesystem to report itself as case sensitive.
|
||||||
|
|
||||||
|
Normally the local backend declares itself as case insensitive on
|
||||||
|
Windows/macOS and case sensitive for everything else. Use this flag
|
||||||
|
to override the default choice.`,
|
||||||
|
Default: false,
|
||||||
|
Advanced: true,
|
||||||
|
}, {
|
||||||
|
Name: "case_insensitive",
|
||||||
|
Help: `Force the filesystem to report itself as case insensitive
|
||||||
|
|
||||||
|
Normally the local backend declares itself as case insensitive on
|
||||||
|
Windows/macOS and case sensitive for everything else. Use this flag
|
||||||
|
to override the default choice.`,
|
||||||
|
Default: false,
|
||||||
|
Advanced: true,
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
fs.Register(fsi)
|
fs.Register(fsi)
|
||||||
|
@ -110,6 +128,8 @@ type Options struct {
|
||||||
NoCheckUpdated bool `config:"no_check_updated"`
|
NoCheckUpdated bool `config:"no_check_updated"`
|
||||||
NoUNC bool `config:"nounc"`
|
NoUNC bool `config:"nounc"`
|
||||||
OneFileSystem bool `config:"one_file_system"`
|
OneFileSystem bool `config:"one_file_system"`
|
||||||
|
CaseSensitive bool `config:"case_sensitive"`
|
||||||
|
CaseInsensitive bool `config:"case_insensitive"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fs represents a local filesystem rooted at root
|
// Fs represents a local filesystem rooted at root
|
||||||
|
@ -228,6 +248,12 @@ func (f *Fs) Features() *fs.Features {
|
||||||
|
|
||||||
// caseInsensitive returns whether the remote is case insensitive or not
|
// caseInsensitive returns whether the remote is case insensitive or not
|
||||||
func (f *Fs) caseInsensitive() bool {
|
func (f *Fs) caseInsensitive() bool {
|
||||||
|
if f.opt.CaseSensitive {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if f.opt.CaseInsensitive {
|
||||||
|
return true
|
||||||
|
}
|
||||||
// FIXME not entirely accurate since you can have case
|
// FIXME not entirely accurate since you can have case
|
||||||
// sensitive Fses on darwin and case insensitive Fses on linux.
|
// sensitive Fses on darwin and case insensitive Fses on linux.
|
||||||
// Should probably check but that would involve creating a
|
// Should probably check but that would involve creating a
|
||||||
|
|
Loading…
Add table
Reference in a new issue