1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

vfs: factor the vfs cache into its own package

This commit is contained in:
Nick Craig-Wood
2020-02-28 14:44:15 +00:00
parent 2b268f9724
commit 40b9e312c6
21 changed files with 408 additions and 362 deletions

12
vfs/vfscommon/path.go Normal file
View File

@@ -0,0 +1,12 @@
package vfscommon
import "path/filepath"
// FindParent returns the parent directory of name, or "" for the root
func FindParent(name string) string {
parent := filepath.Dir(name)
if parent == "." || parent == "/" {
parent = ""
}
return parent
}