aboutsummaryrefslogtreecommitdiff
path: root/weed/util
diff options
context:
space:
mode:
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 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