diff --git a/fssc/ups.db b/fssc/ups.db index 88a9d85..e745657 100644 Binary files a/fssc/ups.db and b/fssc/ups.db differ diff --git a/fstool/build.bat b/fstool/build.bat index bb8ea4f..fa8dbbe 100644 --- a/fstool/build.bat +++ b/fstool/build.bat @@ -1,8 +1,8 @@ @echo off title 文件HASH登记数据库FOR LINUX -color 16 +color 18 set GOOS=linux set GOARCH=amd64 -set CGO_ENABLED=0 +set CGO_ENABLED=1 go build -o fshash main.go \ No newline at end of file diff --git a/fstool/fshash b/fstool/fshash new file mode 100644 index 0000000..ad24e5d Binary files /dev/null and b/fstool/fshash differ diff --git a/fstool/main.go b/fstool/main.go index d3b4121..827cdab 100644 --- a/fstool/main.go +++ b/fstool/main.go @@ -30,7 +30,6 @@ func main() { // 创建数据表 db.CreateTable() //遍历 - // var ftree []string ftree, err := util.GetDirFilePaths(path, false) if err != nil { fmt.Printf("scan error is :%v", err) @@ -44,7 +43,7 @@ func main() { if err != nil { fmt.Printf("relpath error :%v", err) } - fmt.Printf("relpath:%s\n", filepath.Dir(relpath)) + //fmt.Printf("relpath:%s\n", filepath.Dir(relpath)) // 拼装文件信息插入数据库 var stf db.StFileInfo stf.Fhash = util.CalacHash(v) @@ -52,9 +51,13 @@ func main() { // path rlpath := filepath.ToSlash(relpath) + fmt.Printf("relpath:%s\n", filepath.Dir(rlpath)) rlpath = filepath.Join(rlpath, "/") stf.Fpath = filepath.Dir(rlpath) + + // fmt.Printf("relpath:%s\n", filepath.Dir(rlpath)) // insert into db + fmt.Printf("stf :%v\n", stf) db.InsertStf(stf) } // fmt.Printf("scan is :%v", ftree)