mirror of
https://github.com/rclone/rclone.git
synced 2024-11-29 12:04:11 +08:00
50e31c6636
See: https://forum.rclone.org/t/windows-mount-polling-not-recognising-all-changes-made-by-another-box/16708
27 lines
522 B
Go
27 lines
522 B
Go
package vfscommon
|
|
|
|
import (
|
|
"path"
|
|
"path/filepath"
|
|
)
|
|
|
|
// OsFindParent returns the parent directory of name, or "" for the
|
|
// root for OS native paths.
|
|
func OsFindParent(name string) string {
|
|
parent := filepath.Dir(name)
|
|
if parent == "." || parent == "/" {
|
|
parent = ""
|
|
}
|
|
return parent
|
|
}
|
|
|
|
// FindParent returns the parent directory of name, or "" for the root
|
|
// for rclone paths.
|
|
func FindParent(name string) string {
|
|
parent := path.Dir(name)
|
|
if parent == "." || parent == "/" {
|
|
parent = ""
|
|
}
|
|
return parent
|
|
}
|