diff --git a/src/framework/utils/ssh/files.go b/src/framework/utils/ssh/files.go index 66ed8b0e..23604a8b 100644 --- a/src/framework/utils/ssh/files.go +++ b/src/framework/utils/ssh/files.go @@ -68,11 +68,17 @@ func FileList(path, neIp, search string) (string, []FileListRow, error) { // 使用空格对字符串进行切割 fields := strings.Fields(rowStr) + // 无查询过滤会有total总计 if i == 0 && searchStr == "" { totalSize = fields[1] continue } + // 拆分不足7位跳过 + if len(fields) != 7 { + continue + } + // 文件类型 fileMode := fields[0] fileType := "file"