2021-09-09 12:25:25 +00:00
|
|
|
//go:build cmount && cgo && !windows
|
|
|
|
// +build cmount,cgo,!windows
|
2020-11-06 13:21:38 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|