Browse Source

处理hash

master
xyiege 6 months ago
parent
commit
1bd102f4de
  1. 6
      scagent/core/JsonRpc.go

6
scagent/core/JsonRpc.go

@ -119,15 +119,19 @@ func scanFileUnderPath(rootDir string, scope string, logger *zap.Logger, replay
var fsize string var fsize string
fsize = "0kb" fsize = "0kb"
// hash
var hash string
// //
if file.IsDir() { if file.IsDir() {
fsize = "0" fsize = "0"
hash = ""
} else { } else {
fsize = fmt.Sprintf("%d", fileinfo.Size()) fsize = fmt.Sprintf("%d", fileinfo.Size())
hash = util.CalacHash(realpath)
} }
// 加入到列表 // 加入到列表
hash := util.CalacHash(realpath)
flplist.Flist = append(flplist.Flist, FloopJson{Path: file.Name(), Size: fsize, Hash: hash}) flplist.Flist = append(flplist.Flist, FloopJson{Path: file.Name(), Size: fsize, Hash: hash})
// allFiles = append(allFiles, filepath.Join(rootDir, file.Name())) // allFiles = append(allFiles, filepath.Join(rootDir, file.Name()))
} }

Loading…
Cancel
Save