mirror of
https://github.com/rclone/rclone.git
synced 2026-06-30 10:55:14 -04:00
On Windows, passing "*" as mountPoint to the mount/mount RC command auto-assigns a drive letter (e.g. "Z:"), but the resolved letter was never propagated back to mountlib. This caused liveMounts to be keyed on the literal "*", breaking tracking of multiple mounts and making unmount unreliable. Change MountFn to return the actual mount point as an additional return value. Update MountPoint.Mount() to store the resolved value, and mountRc() to use it as the liveMounts key. The mount/mount RC response now returns the actual mountPoint so callers can discover which drive letter was assigned.
34 lines
1.0 KiB
Go
34 lines
1.0 KiB
Go
//go:build brew && darwin
|
|
|
|
// Package cmount implements a FUSE mounting system for rclone remotes.
|
|
//
|
|
// Build for macos with the brew tag to handle the absence
|
|
// of fuse and print an appropriate error message
|
|
package cmount
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/rclone/rclone/cmd/mountlib"
|
|
"github.com/rclone/rclone/vfs"
|
|
)
|
|
|
|
func init() {
|
|
name := "mount"
|
|
cmd := mountlib.NewMountCommand(name, false, mount)
|
|
cmd.Aliases = append(cmd.Aliases, "cmount")
|
|
mountlib.AddRc("cmount", mount)
|
|
}
|
|
|
|
// mount the file system
|
|
//
|
|
// The mount point will be ready when this returns.
|
|
//
|
|
// returns an error, and an error channel for the serve process to
|
|
// report an error when fusermount is called.
|
|
func mount(_ *vfs.VFS, _ string, _ *mountlib.Options) (<-chan error, func() error, string, error) {
|
|
return nil, nil, "", errors.New("rclone mount is not supported on MacOS when rclone is installed via Homebrew. " +
|
|
"Please install the rclone binaries available at https://rclone.org/downloads/ " +
|
|
"instead if you want to use the rclone mount command")
|
|
}
|