1
mirror of https://github.com/rclone/rclone synced 2024-12-30 23:46:23 +01:00

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

Before this change we would unconditionally set the OSXFUSE options
noappledouble and noapplexattr.

However the noapplexattr options caused problems with copies in the
Finder.

Now the default for noapplexattr is false so we don't add the option
by default and the user can override the defaults using the
--noappledouble and --noapplexattr flags.
This commit is contained in:
Nick Craig-Wood 2018-05-03 09:45:24 +01:00
parent 6ce32e4661
commit 9d8d7ae1f0
3 changed files with 21 additions and 5 deletions

View File

@ -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

View File

@ -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())
}

View File

@ -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)