mirror of https://github.com/schollz/croc.git
use best speed
This commit is contained in:
parent
09a16cacd5
commit
4e88975ed4
|
@ -61,11 +61,13 @@ func (c *Croc) processFile(src string) (err error) {
|
|||
fd.IsDir = info.Mode().IsDir()
|
||||
|
||||
// zip file
|
||||
log.Debug("zipping file")
|
||||
c.crocFile, err = zipFile(path.Join(pathToFile, filename), c.UseCompression)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
log.Debug("...finished zipping")
|
||||
fd.IsCompressed = c.UseCompression
|
||||
fd.IsEncrypted = c.UseEncryption
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ func zipFile(fname string, compress bool) (writtenFilename string, err error) {
|
|||
zipWriter := zip.NewWriter(newfile)
|
||||
zipWriter.RegisterCompressor(zip.Deflate, func(out io.Writer) (io.WriteCloser, error) {
|
||||
if compress {
|
||||
return flate.NewWriter(out, flate.BestCompression)
|
||||
return flate.NewWriter(out, flate.BestSpeed)
|
||||
} else {
|
||||
return flate.NewWriter(out, flate.NoCompression)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue