Browse Source

文件删除

master
xyiege 1 month ago
parent
commit
ae0cae2c69
  1. 2
      scagent/core/UpFile.go
  2. 5
      scagent/util/fsutil.go

2
scagent/core/UpFile.go

@ -101,6 +101,8 @@ func (f *UpFileService) UnzipArchive(info FileInfo, reply *string) error {
}()
// 返回true的字符串
if retMsg := <-ret; retMsg == "uzok" {
// 删除zip文件
util.DeleteFile(info.FileName)
*reply = retMsg
}
return nil

5
scagent/util/fsutil.go

@ -416,3 +416,8 @@ func ReadConfig() {
}
config.G.Port = fmt.Sprintf("%d", iport)
}
// 删除文件
func DeleteFile(filePath string) error {
return os.Remove(filePath)
}

Loading…
Cancel
Save