1
mirror of https://github.com/rclone/rclone synced 2024-12-29 22:26:24 +01:00
rclone/cmd/cmount/mountpoint_other.go
2021-09-09 20:43:59 +03:00

23 lines
476 B
Go

//go:build cmount && cgo && !windows
// +build cmount,cgo,!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
}