aboutsummaryrefslogtreecommitdiff
path: root/weed/filer2/filer_structure.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/filer2/filer_structure.go')
-rw-r--r--weed/filer2/filer_structure.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/weed/filer2/filer_structure.go b/weed/filer2/filer_structure.go
index c31d878cf..1cff96253 100644
--- a/weed/filer2/filer_structure.go
+++ b/weed/filer2/filer_structure.go
@@ -21,6 +21,11 @@ func (fp FullPath) DirAndName() (string, string) {
return dir[:len(dir)-1], name
}
+func (fp FullPath) Name() (string) {
+ _, name := filepath.Split(string(fp))
+ return name
+}
+
type Attr struct {
Mtime time.Time // time of last modification
Crtime time.Time // time of creation (OS X only)
@@ -29,6 +34,10 @@ type Attr struct {
Gid uint32 // group gid
}
+func (attr Attr) IsDirectory() (bool) {
+ return attr.Mode & os.ModeDir > 0
+}
+
type Entry struct {
FullPath