sys - remove temp traces xtract
This commit is contained in:
parent
732697fc75
commit
1767ef7a07
|
@ -41,11 +41,8 @@ func (x *Xtract) setCompressedFile(dumpName string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Xtract) writeUncompressedData(out *bytes.Buffer) bool {
|
func (x *Xtract) writeUncompressedData(out *bytes.Buffer) bool {
|
||||||
fmt.Printf("writeUncompressed %s\n", x.outFile)
|
|
||||||
fmt.Printf("writeUncompressedData :\n%s\n", string(out.Bytes()[0:50]))
|
|
||||||
err := os.WriteFile(x.outFile, out.Bytes(), 0644)
|
err := os.WriteFile(x.outFile, out.Bytes(), 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("err uncompressed : %+v\n", err)
|
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
@ -53,19 +50,16 @@ func (x *Xtract) writeUncompressedData(out *bytes.Buffer) bool {
|
||||||
|
|
||||||
func (x *Xtract) UnGzip(dumpName string) bool {
|
func (x *Xtract) UnGzip(dumpName string) bool {
|
||||||
x.setCompressedFile(dumpName)
|
x.setCompressedFile(dumpName)
|
||||||
fmt.Printf("xtract %s : %+v\n", dumpName, x)
|
|
||||||
var out bytes.Buffer
|
var out bytes.Buffer
|
||||||
r, err := gzip.NewReader(x.reader)
|
r, err := gzip.NewReader(x.reader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
var w64 int64 = 0
|
|
||||||
if x.withBar {
|
if x.withBar {
|
||||||
w64, err = io.Copy(io.MultiWriter(&out, *x.bar), r)
|
_, err = io.Copy(io.MultiWriter(&out, *x.bar), r)
|
||||||
} else {
|
} else {
|
||||||
w64, err = io.Copy(&out, r)
|
_, err = io.Copy(&out, r)
|
||||||
}
|
}
|
||||||
fmt.Printf(" xtract (%d) err : %v\n", w64, err)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user