From 2042af5f0cdc037d250bd20f2c9d45273ddd52ed Mon Sep 17 00:00:00 2001 From: "Jay R. Wren" Date: Sun, 24 Oct 2021 11:01:03 -0400 Subject: [PATCH] add ino, hlnkc to json --- pkg/analyze/encode.go | 3 +++ report/import.go | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/pkg/analyze/encode.go b/pkg/analyze/encode.go index c9f20ff02..3db993210 100644 --- a/pkg/analyze/encode.go +++ b/pkg/analyze/encode.go @@ -79,6 +79,9 @@ func (f *File) EncodeJSON(writer io.Writer, topLevel bool) error { if f.Flag == '@' { buff = append(buff, []byte(`,"notreg":true`)...) } + if f.Flag == 'H' { + buff = append(buff, []byte(`,"ino":`+strconv.FormatUint(f.Mli, 10)+`,"hlnkc":true`)...) + } buff = append(buff, '}') diff --git a/report/import.go b/report/import.go index 17965e384..a78ff25e8 100644 --- a/report/import.go +++ b/report/import.go @@ -85,6 +85,12 @@ func processDir(items []interface{}) (*analyze.Dir, error) { } else { file.Flag = ' ' } + if mli, ok := item["ino"].(float64); ok { + file.Mli = uint64(mli) + } + if _, ok := item["hlnkc"].(bool); ok { + file.Flag = 'H' + } file.Parent = dir