aboutsummaryrefslogtreecommitdiff
path: root/weed/util
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-25 22:19:19 -0700
committerChris Lu <chris.lu@gmail.com>2020-03-25 22:19:19 -0700
commit2e4fadd10aa8835e7bcbbe25b46169a6335154f6 (patch)
treefb47187d2ccd70c004ed7906b9c0842bc590c968 /weed/util
parent5c5ddc740dc224cfecb4107d6b728ed70fbcf4a3 (diff)
downloadseaweedfs-2e4fadd10aa8835e7bcbbe25b46169a6335154f6.tar.xz
seaweedfs-2e4fadd10aa8835e7bcbbe25b46169a6335154f6.zip
fix fscache move
Diffstat (limited to 'weed/util')
-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:], "/")
+}