Browse Source

Create INode from given path.

Blallo 5 years ago
parent
commit
a38da4dfe7
1 changed files with 6 additions and 0 deletions
  1. 6 0
      sizer/main.go

+ 6 - 0
sizer/main.go

@@ -116,7 +116,13 @@ func ls(path string) ([]string, error) {
 	return content, nil
 }
 
+func INodeFromPath(path string) (*INode, error) {
+	kind, _, err := IdentifyType(path)
+	if err != nil {
+		return nil, err
 	}
+	i := NewINode(kind, 0, path)
+	return i, nil
 }
 
 func (i *INode) size(wg *sync.WaitGroup) {