2021-09-09 14:25:25 +02:00
|
|
|
//go:build cmount && cgo && !windows
|
|
|
|
// +build cmount,cgo,!windows
|
2020-11-06 14:21:38 +01:00
|
|
|
|
|
|
|
package cmount
|
|
|
|
|
|
|
|
import (
|
2021-11-04 11:12:57 +01:00
|
|
|
"errors"
|
|
|
|
"fmt"
|
2020-11-06 14:21:38 +01:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/rclone/rclone/cmd/mountlib"
|
|
|
|
)
|
|
|
|
|
|
|
|
func getMountpoint(mountPath string, opt *mountlib.Options) (string, error) {
|
|
|
|
fi, err := os.Stat(mountPath)
|
|
|
|
if err != nil {
|
2021-11-04 11:12:57 +01:00
|
|
|
return "", fmt.Errorf("failed to retrieve mount path information: %w", err)
|
2020-11-06 14:21:38 +01:00
|
|
|
}
|
|
|
|
if !fi.IsDir() {
|
|
|
|
return "", errors.New("mount path is not a directory")
|
|
|
|
}
|
|
|
|
return mountPath, nil
|
|
|
|
}
|