mirror of
https://github.com/rclone/rclone.git
synced 2025-08-24 03:45:45 +02:00
vfs: fix OS vs Unix path confusion - fixes ChangeNotify on Windows
See: https://forum.rclone.org/t/windows-mount-polling-not-recognising-all-changes-made-by-another-box/16708
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
package vfscommon
|
||||
|
||||
import "path/filepath"
|
||||
import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// FindParent returns the parent directory of name, or "" for the root
|
||||
func FindParent(name string) string {
|
||||
// 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
|
||||
}
|
||||
|
Reference in New Issue
Block a user