mirror of
https://github.com/rclone/rclone.git
synced 2024-11-27 10:54:56 +01:00
e92cb9e8f8
Add --network-mode option to activate mounting as network drive without having to set volume prefix. Add support for automatic drive letter assignment (not specific to network drive mounting). Allow full network share unc path in --volname, which will also implicitely activate network drive mounting. Allow full network share unc path as mountpoint, which will also implicitely activate network drive mounting, and the specified path will be used as volume prefix and the remote will be mounted on an automatically assigned drive letter instead.
24 lines
459 B
Go
24 lines
459 B
Go
// +build cmount
|
|
// +build cgo
|
|
// +build !windows
|
|
|
|
package cmount
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/pkg/errors"
|
|
"github.com/rclone/rclone/cmd/mountlib"
|
|
)
|
|
|
|
func getMountpoint(mountPath string, opt *mountlib.Options) (string, error) {
|
|
fi, err := os.Stat(mountPath)
|
|
if err != nil {
|
|
return "", errors.Wrap(err, "failed to retrieve mount path information")
|
|
}
|
|
if !fi.IsDir() {
|
|
return "", errors.New("mount path is not a directory")
|
|
}
|
|
return mountPath, nil
|
|
}
|