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

This commit is contained in:
Nick Craig-Wood 2023-03-13 11:28:26 +00:00
parent 5f4d7154c0
commit bd46f01eb4
2 changed files with 7 additions and 1 deletions

View File

@ -160,7 +160,11 @@ func mount(VFS *vfs.VFS, mountPath string, opt *mountlib.Options) (<-chan error,
fsys := NewFS(VFS) fsys := NewFS(VFS)
host := fuse.NewFileSystemHost(fsys) host := fuse.NewFileSystemHost(fsys)
host.SetCapReaddirPlus(true) // only works on Windows 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 // Create options
options := mountOptions(VFS, opt.DeviceName, mountpoint, opt) options := mountOptions(VFS, opt.DeviceName, mountpoint, opt)

View File

@ -48,6 +48,7 @@ type Options struct {
DaemonTimeout time.Duration // OSXFUSE only DaemonTimeout time.Duration // OSXFUSE only
AsyncRead bool AsyncRead bool
NetworkMode bool // Windows only NetworkMode bool // Windows only
CaseInsensitive fs.Tristate
} }
// DefaultOpt is the default values for creating the mount // 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.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.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.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 // Windows and OSX
flags.StringVarP(flagSet, &Opt.VolumeName, "volname", "", Opt.VolumeName, "Set the volume name (supported on Windows and OSX only)") flags.StringVarP(flagSet, &Opt.VolumeName, "volname", "", Opt.VolumeName, "Set the volume name (supported on Windows and OSX only)")
// OSX only // OSX only