feat: Start normalization of seeking behaviour in file and tape

This commit is contained in:
Felicitas Pojtinger
2021-11-17 21:38:01 +01:00
parent 7a633bfa06
commit 09b7bccc4c
+17 -5
View File
@@ -3,6 +3,7 @@ package main
import ( import (
"archive/tar" "archive/tar"
"flag" "flag"
"io"
"log" "log"
"os" "os"
) )
@@ -33,10 +34,21 @@ func main() {
tr := tar.NewReader(f) tr := tar.NewReader(f)
hdr, err := tr.Next() for {
if err != nil { hdr, err := tr.Next()
panic(err) if err != nil {
} panic(err)
}
log.Println(hdr) log.Println(hdr)
curr, err := f.Seek(0, io.SeekCurrent)
if err != nil {
panic(err)
}
if currentRecord := ((curr + hdr.Size) / blockSize) / int64(*recordSize); currentRecord > int64(*record) {
break
}
}
} }