Browse Source

调整配置

master
453530270@qq.com 2 years ago
parent
commit
9a5d936499
  1. BIN
      fssc/ups.db
  2. 4
      fstool/build.bat
  3. BIN
      fstool/fshash
  4. 7
      fstool/main.go

BIN
fssc/ups.db

Binary file not shown.

4
fstool/build.bat

@ -1,8 +1,8 @@
@echo off @echo off
title 文件HASH登记数据库FOR LINUX title 文件HASH登记数据库FOR LINUX
color 16 color 18
set GOOS=linux set GOOS=linux
set GOARCH=amd64 set GOARCH=amd64
set CGO_ENABLED=0 set CGO_ENABLED=1
go build -o fshash main.go go build -o fshash main.go

BIN
fstool/fshash

Binary file not shown.

7
fstool/main.go

@ -30,7 +30,6 @@ func main() {
// 创建数据表 // 创建数据表
db.CreateTable() db.CreateTable()
//遍历 //遍历
// var ftree []string
ftree, err := util.GetDirFilePaths(path, false) ftree, err := util.GetDirFilePaths(path, false)
if err != nil { if err != nil {
fmt.Printf("scan error is :%v", err) fmt.Printf("scan error is :%v", err)
@ -44,7 +43,7 @@ func main() {
if err != nil { if err != nil {
fmt.Printf("relpath error :%v", err) 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 var stf db.StFileInfo
stf.Fhash = util.CalacHash(v) stf.Fhash = util.CalacHash(v)
@ -52,9 +51,13 @@ func main() {
// path // path
rlpath := filepath.ToSlash(relpath) rlpath := filepath.ToSlash(relpath)
fmt.Printf("relpath:%s\n", filepath.Dir(rlpath))
rlpath = filepath.Join(rlpath, "/") rlpath = filepath.Join(rlpath, "/")
stf.Fpath = filepath.Dir(rlpath) stf.Fpath = filepath.Dir(rlpath)
// fmt.Printf("relpath:%s\n", filepath.Dir(rlpath))
// insert into db // insert into db
fmt.Printf("stf :%v\n", stf)
db.InsertStf(stf) db.InsertStf(stf)
} }
// fmt.Printf("scan is :%v", ftree) // fmt.Printf("scan is :%v", ftree)

Loading…
Cancel
Save