From dcb23d17637ff8d5455d74ec7fcfde946d19a84b Mon Sep 17 00:00:00 2001 From: Jeremy Stribling Date: Thu, 15 Feb 2018 10:18:15 -0800 Subject: [PATCH] options: introduce NoBrowse option for OSX https://github.com/osxfuse/osxfuse/wiki/Mount-options#nobrowse --- options.go | 8 ++++++++ options_darwin.go | 5 +++++ options_freebsd.go | 4 ++++ options_linux.go | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/options.go b/options.go index 65ce8a54..3ee709ab 100644 --- a/options.go +++ b/options.go @@ -106,6 +106,14 @@ func NoAppleXattr() MountOption { return noAppleXattr } +// NoBrowse makes OSXFUSE mark the volume as non-browsable, so that +// Finder won't automatically browse it. +// +// OS X only. Others ignore this option. +func NoBrowse() MountOption { + return noBrowse +} + // ExclCreate causes O_EXCL flag to be set for only "truly" exclusive creates, // i.e. create calls for which the initiator explicitly set the O_EXCL flag. // diff --git a/options_darwin.go b/options_darwin.go index faa9d78e..a85e64cb 100644 --- a/options_darwin.go +++ b/options_darwin.go @@ -33,3 +33,8 @@ func exclCreate(conf *mountConfig) error { conf.options["excl_create"] = "" return nil } + +func noBrowse(conf *mountConfig) error { + conf.options["nobrowse"] = "" + return nil +} diff --git a/options_freebsd.go b/options_freebsd.go index 7c164b13..2c956e7f 100644 --- a/options_freebsd.go +++ b/options_freebsd.go @@ -26,3 +26,7 @@ func noAppleDouble(conf *mountConfig) error { func exclCreate(conf *mountConfig) error { return nil } + +func noBrowse(conf *mountConfig) error { + return nil +} diff --git a/options_linux.go b/options_linux.go index 13f0896d..2c925b18 100644 --- a/options_linux.go +++ b/options_linux.go @@ -23,3 +23,7 @@ func noAppleDouble(conf *mountConfig) error { func exclCreate(conf *mountConfig) error { return nil } + +func noBrowse(conf *mountConfig) error { + return nil +}