mirror of
https://github.com/vbatts/tar-split.git
synced 2024-11-29 02:55:39 +00:00
main.go: actually write the _post_ buffer ...
This commit is contained in:
parent
50168a6bb3
commit
c9b618ab48
1 changed files with 8 additions and 4 deletions
12
main.go
12
main.go
|
@ -45,19 +45,23 @@ func main() {
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
pre := tr.RawBytes()
|
pre := tr.RawBytes()
|
||||||
output.Write(pre)
|
output.Write(pre)
|
||||||
|
sum += int64(len(pre))
|
||||||
|
|
||||||
var i int64
|
var i int64
|
||||||
if i, err = io.Copy(output, tr); err != nil {
|
if i, err = io.Copy(output, tr); err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
post := tr.RawBytes()
|
|
||||||
output.Write(pre)
|
|
||||||
fmt.Println(hdr.Name, "pre:", len(pre), "read:", i, "post:", len(post))
|
|
||||||
sum += int64(len(pre))
|
|
||||||
sum += i
|
sum += i
|
||||||
|
|
||||||
|
post := tr.RawBytes()
|
||||||
|
output.Write(post)
|
||||||
sum += int64(len(post))
|
sum += int64(len(post))
|
||||||
|
|
||||||
|
fmt.Println(hdr.Name, "pre:", len(pre), "read:", i, "post:", len(post))
|
||||||
}
|
}
|
||||||
|
|
||||||
if size != sum {
|
if size != sum {
|
||||||
|
|
Loading…
Reference in a new issue