MCPcopy
hub / github.com/aceld/zinx / ZipToFile

Function ZipToFile

zutils/witer.go:233–243  ·  view source on GitHub ↗

ZipToFile 压缩至文件 @params dst string 压缩文件目标路径 @params src string 待压缩源文件/目录路径 @return error 错误信息

(dst, src string)

Source from the content-addressed store, hash-verified

231// @params src string 待压缩源文件/目录路径
232// @return error 错误信息
233func ZipToFile(dst, src string) error {
234 // 创建一个ZIP文件
235 fw, err := os.Create(filepath.Clean(dst))
236 if err != nil {
237 return err
238 }
239 defer fw.Close()
240
241 // 执行压缩
242 return Zip(fw, src)
243}
244
245// Zip 压缩文件或目录
246// @params dst io.Writer 压缩文件可写流

Callers 1

rotateMethod · 0.85

Calls 2

ZipFunction · 0.85
CloseMethod · 0.80

Tested by

no test coverage detected