Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

cmount: add --mount-case-insensitive to force the mount to be case insensitive

Nick Craig-Woodbd46f01eb481
diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.go
index 2b7b5d19e..7eb6a209c 100644
--- a/cmd/cmount/mount.go
+++ b/cmd/cmount/mount.go
@@ -160,7 +160,11 @@ func mount(VFS *vfs.VFS, mountPath string, opt *mountlib.Options) (<-chan error,
fsys := NewFS(VFS)
host := fuse.NewFileSystemHost(fsys)
host.SetCapReaddirPlus(true) // only works on Windows
- host.SetCapCaseInsensitive(f.Features().CaseInsensitive)
+ if opt.CaseInsensitive.Valid {
+ host.SetCapCaseInsensitive(opt.CaseInsensitive.Value)
+ } else {
+ host.SetCapCaseInsensitive(f.Features().CaseInsensitive)
+ }
// Create options
options := mountOptions(VFS, opt.DeviceName, mountpoint, opt)
diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go
index 25fc272e1..a783b2b47 100644
--- a/cmd/mountlib/mount.go
+++ b/cmd/mountlib/mount.go
@@ -48,6 +48,7 @@ type Options struct {
DaemonTimeout time.Duration // OSXFUSE only
AsyncRead bool
NetworkMode bool // Windows only
+ CaseInsensitive fs.Tristate
}
// DefaultOpt is the default values for creating the mount
@@ -139,6 +140,7 @@ func AddFlags(flagSet *pflag.FlagSet) {
flags.FVarP(flagSet, &Opt.MaxReadAhead, "max-read-ahead", "", "The number of bytes that can be prefetched for sequential reads (not supported on Windows)")
flags.BoolVarP(flagSet, &Opt.WritebackCache, "write-back-cache", "", Opt.WritebackCache, "Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows)")
flags.StringVarP(flagSet, &Opt.DeviceName, "devname", "", Opt.DeviceName, "Set the device name - default is remote:path")
+ flags.FVarP(flagSet, &Opt.CaseInsensitive, "mount-case-insensitive", "", "Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto)")
// Windows and OSX
flags.StringVarP(flagSet, &Opt.VolumeName, "volname", "", Opt.VolumeName, "Set the volume name (supported on Windows and OSX only)")
// OSX only