1
mirror of https://github.com/rclone/rclone synced 2024-12-21 11:45:56 +01:00
rclone/cmd/cmount/mountpoint_other.go

24 lines
471 B
Go
Raw Normal View History

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