forked from mirrors/tar-split
WIP sparse file testing
This commit is contained in:
parent
bece0c7009
commit
08360d3e06
4 changed files with 83 additions and 4 deletions
|
@ -1,8 +1,10 @@
|
|||
package asm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/vbatts/tar-split/archive/tar"
|
||||
"github.com/vbatts/tar-split/tar/storage"
|
||||
|
@ -92,6 +94,15 @@ func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io
|
|||
}
|
||||
}
|
||||
|
||||
if hdr.Typeflag == tar.TypeGNUSparse {
|
||||
e := storage.Entry{
|
||||
Type: storage.SparseFileType,
|
||||
}
|
||||
fmt.Fprintln(os.Stderr, "WHOOP")
|
||||
e.SetName(hdr.Name)
|
||||
_, err = p.AddEntry(e)
|
||||
}
|
||||
|
||||
entry := storage.Entry{
|
||||
Type: storage.FileType,
|
||||
Size: hdr.Size,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue