diff --git a/core/commands/files/files.go b/core/commands/files/files.go index f159e56c98e1..03e4e33243b5 100644 --- a/core/commands/files/files.go +++ b/core/commands/files/files.go @@ -115,11 +115,20 @@ func statNode(ds dag.DAGService, fsn mfs.FSNode) (*Object, error) { return nil, err } + var ndtype string + switch fsn.Type() { + case mfs.TDir: + ndtype = "directory" + case mfs.TFile: + ndtype = "file" + } + return &Object{ Hash: k.B58String(), Blocks: len(nd.Links), Size: d.GetFilesize(), CumulativeSize: cumulsize, + Type: ndtype, }, nil } @@ -187,6 +196,7 @@ type Object struct { Size uint64 CumulativeSize uint64 Blocks int + Type string } type FilesLsOutput struct {