|
|
|
@ -9,6 +9,7 @@ import ( |
|
|
|
"path" |
|
|
|
"path/filepath" |
|
|
|
"strings" |
|
|
|
"xtcfs/config" |
|
|
|
) |
|
|
|
|
|
|
|
/** |
|
|
|
@ -129,10 +130,14 @@ func DecompressZip(zpFname string) error { |
|
|
|
return err |
|
|
|
} |
|
|
|
dir := filepath.Dir(zpFname) |
|
|
|
fmt.Printf("zip file path:%s\n", dir) |
|
|
|
|
|
|
|
defer archive.Close() |
|
|
|
// 遍历目录
|
|
|
|
for _, f := range archive.File { |
|
|
|
filePath := filepath.Join(dir, f.Name) |
|
|
|
// zip 解压的时候,路径为监听的路径
|
|
|
|
filePath := filepath.Join(config.G.FilePath, f.Name) |
|
|
|
//filePath := filepath.Join(dir, f.Name)
|
|
|
|
if f.FileInfo().IsDir() { |
|
|
|
os.MkdirAll(filePath, os.ModePerm) |
|
|
|
continue |
|
|
|
|