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:
12
vfs/vfscommon/path.go
Normal file
12
vfs/vfscommon/path.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user