示例#1
0
文件: read.go 项目: Patrolavia/ggpk
func doEntry(f *os.File, e record.DirectoryEntry, cur *Directory) error {
	if _, err := f.Seek(int64(e.Offset), 0); err != nil {
		return err
	}
	h, err := record.Header(f)
	if err != nil {
		return err
	}
	h.Offset = e.Offset + uint64(h.ByteLength())
	return doHeader(f, h, cur, e.Timestamp)
}
示例#2
0
文件: check.go 项目: Patrolavia/ggpk
func doEntry(e record.DirectoryEntry, f *os.File, path string) []byte {
	if _, err := f.Seek(int64(e.Offset), 0); err != nil {
		fatalf("Cannot seek to %d: %s", e.Offset, err)
	}
	h, err := record.Header(f)
	if err != nil {
		fatalf("Cannot read header from %d: %s", e.Offset, err)
	}
	h.Offset = e.Offset + uint64(h.ByteLength())
	return doHeader(h, f, path)
}