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

mount,cmount: make --noappledouble --noapplexattr and change defaults #2287

Nick Craig-Wood9d8d7ae1f08f
diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.go
index 096710745..b40c7c6c6 100644
--- a/cmd/cmount/mount.go
+++ b/cmd/cmount/mount.go
@@ -54,8 +54,12 @@ func mountOptions(device string, mountpoint string) (options []string) {
// OSX options
if runtime.GOOS == "darwin" {
options = append(options, "-o", "volname="+mountlib.VolumeName)
- options = append(options, "-o", "noappledouble")
- options = append(options, "-o", "noapplexattr")
+ if mountlib.NoAppleDouble {
+ options = append(options, "-o", "noappledouble")
+ }
+ if mountlib.NoAppleXattr {
+ options = append(options, "-o", "noapplexattr")
+ }
}
// Windows options
diff --git a/cmd/mount/mount.go b/cmd/mount/mount.go
index 5f2ae6573..93b43198a 100644
--- a/cmd/mount/mount.go
+++ b/cmd/mount/mount.go
@@ -28,9 +28,8 @@ func mountOptions(device string) (options []fuse.MountOption) {
options = []fuse.MountOption{
fuse.MaxReadahead(uint32(mountlib.MaxReadAhead)),
fuse.Subtype("rclone"),
- fuse.FSName(device), fuse.VolumeName(mountlib.VolumeName),
- fuse.NoAppleDouble(),
- fuse.NoAppleXattr(),
+ fuse.FSName(device),
+ fuse.VolumeName(mountlib.VolumeName),
// Options from benchmarking in the fuse module
//fuse.MaxReadahead(64 * 1024 * 1024),
@@ -39,6 +38,12 @@ func mountOptions(device string) (options []fuse.MountOption) {
// which is probably related to errors people are having
//fuse.WritebackCache(),
}
+ if mountlib.NoAppleDouble {
+ options = append(options, fuse.NoAppleDouble())
+ }
+ if mountlib.NoAppleXattr {
+ options = append(options, fuse.NoAppleXattr())
+ }
if mountlib.AllowNonEmpty {
options = append(options, fuse.AllowNonEmptyMount())
}
diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go
index 7efecab42..a6fa42202 100644
--- a/cmd/mountlib/mount.go
+++ b/cmd/mountlib/mount.go
@@ -31,6 +31,8 @@ var (
ExtraFlags []string
AttrTimeout = 1 * time.Second // how long the kernel caches attribute for
VolumeName string
+ NoAppleDouble = true // use noappledouble by default
+ NoAppleXattr = false // do not use noapplexattr by default
)
// Check is folder is empty
@@ -273,6 +275,11 @@ be copied to the vfs cache before opening with --vfs-cache-mode full.
flags.BoolVarP(flagSet, &Daemon, "daemon", "", Daemon, "Run mount as a daemon (background mode).")
flags.StringVarP(flagSet, &VolumeName, "volname", "", VolumeName, "Set the volume name (not supported by all OSes).")
+ if runtime.GOOS == "darwin" {
+ flags.BoolVarP(flagSet, &NoAppleDouble, "noappledouble", "", NoAppleDouble, "Sets the OSXFUSE option noappledouble.")
+ flags.BoolVarP(flagSet, &NoAppleXattr, "noapplexattr", "", NoAppleXattr, "Sets the OSXFUSE option noapplexattr.")
+ }
+
// Add in the generic flags
vfsflags.AddFlags(flagSet)