aboutsummaryrefslogtreecommitdiff
path: root/weed/util/fullpath.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-08-07 00:56:15 -0700
committerchrislu <chris.lu@gmail.com>2022-08-07 00:56:15 -0700
commit1a4bf0dcb5852c62070fe9627b7e63c5d55bb460 (patch)
tree33029c976e849f6e5a29e2eb7cd5d905a77307a8 /weed/util/fullpath.go
parent02b38f894b97be945e7be69a0f897d24f726a957 (diff)
downloadseaweedfs-1a4bf0dcb5852c62070fe9627b7e63c5d55bb460.tar.xz
seaweedfs-1a4bf0dcb5852c62070fe9627b7e63c5d55bb460.zip
filer.sync: parallelize the filer.sync
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 92580dc38..6ac2af14f 100644
--- a/weed/util/fullpath.go
+++ b/weed/util/fullpath.go
@@ -63,6 +63,14 @@ func Join(names ...string) string {
func JoinPath(names ...string) FullPath {
return FullPath(Join(names...))
}
+
+func (fp FullPath) IsUnder(other FullPath) bool {
+ if other == "/" {
+ return true
+ }
+ return strings.HasPrefix(string(fp), string(other)+"/")
+}
+
func Split(separatedValues string, sep string) []string {
if separatedValues == "" {
return nil