*: include the original source and a go mod
This is a silly thing from Jun 29 2016 just to view the TAR headers Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
11e6b4b2bc
commit
a377d29cf7
2 changed files with 26 additions and 0 deletions
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module git.thisco.de/vbatts/tarinfo
|
||||||
|
|
||||||
|
go 1.13
|
23
main.go
Normal file
23
main.go
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"archive/tar"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fh, err := os.Open(os.Args[1])
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
tr := tar.NewReader(fh)
|
||||||
|
for {
|
||||||
|
hdr, err := tr.Next()
|
||||||
|
if err != nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
fmt.Printf("%#v\n", hdr)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue