aboutsummaryrefslogtreecommitdiff
path: root/weed/util/fullpath.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/util/fullpath.go')
-rw-r--r--weed/util/fullpath.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/weed/util/fullpath.go b/weed/util/fullpath.go
index 4a2e2854f..a0f907d3d 100644
--- a/weed/util/fullpath.go
+++ b/weed/util/fullpath.go
@@ -38,3 +38,11 @@ func (fp FullPath) Child(name string) FullPath {
func (fp FullPath) AsInode() uint64 {
return uint64(HashStringToLong(string(fp)))
}
+
+// split, but skipping the root
+func (fp FullPath) Split() []string {
+ if fp == "" || fp == "/"{
+ return []string{}
+ }
+ return strings.Split(string(fp)[1:], "/")
+}