feat: Start normalization of seeking behaviour in file and tape
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user