Home | History | Annotate | Download | only in tar

Lines Matching refs:hdr

109 	hdr, err := tr.next()
111 return hdr, err
127 hdr, rawHdr, err := tr.readHeader()
131 if err := tr.handleRegularFile(hdr); err != nil {
136 switch hdr.Typeflag {
154 switch hdr.Typeflag {
168 if err := mergePAX(hdr, extHdrs); err != nil {
174 if err := tr.handleRegularFile(hdr); err != nil {
180 if err := tr.handleSparseFile(hdr, rawHdr, extHdrs); err != nil {
183 return hdr, nil // This is a file, so stop
191 func (tr *Reader) handleRegularFile(hdr *Header) error {
192 nb := hdr.Size
193 if isHeaderOnlyType(hdr.Typeflag) {
207 func (tr *Reader) handleSparseFile(hdr *Header, rawHdr *block, extHdrs map[string]string) error {
210 if hdr.Typeflag == TypeGNUSparse {
211 sp, err = tr.readOldGNUSparseMap(hdr, rawHdr)
216 sp, err = tr.checkForGNUSparsePAXHeaders(hdr, extHdrs)
225 tr.curr, err = newSparseFileReader(tr.curr, sp, hdr.Size)
233 func (tr *Reader) checkForGNUSparsePAXHeaders(hdr *Header, headers map[string]string) ([]sparseEntry, error) {
261 // Update hdr from GNU sparse PAX headers
263 hdr.Name = sparseName
270 hdr.Size = realSize
276 hdr.Size = realSize
296 func mergePAX(hdr *Header, headers map[string]string) (err error) {
301 hdr.Name = v
303 hdr.Linkname = v
305 hdr.Uname = v
307 hdr.Gname = v
310 hdr.Uid = int(id64) // Integer overflow possible
313 hdr.Gid = int(id64) // Integer overflow possible
315 hdr.AccessTime, err = parsePAXTime(v)
317 hdr.ModTime, err = parsePAXTime(v)
319 hdr.ChangeTime, err = parsePAXTime(v)
321 hdr.Size, err = strconv.ParseInt(v, 10, 64)
324 if hdr.Xattrs == nil {
325 hdr.Xattrs = make(map[string]string)
327 hdr.Xattrs[k[len(paxXattr):]] = v
453 hdr := new(Header)
457 hdr.Name = p.parseString(v7.Name())
458 hdr.Mode = p.parseNumeric(v7.Mode())
459 hdr.Uid = int(p.parseNumeric(v7.UID()))
460 hdr.Gid = int(p.parseNumeric(v7.GID()))
461 hdr.Size = p.parseNumeric(v7.Size())
462 hdr.ModTime = time.Unix(p.parseNumeric(v7.ModTime()), 0)
463 hdr.Typeflag = v7.TypeFlag()[0]
464 hdr.Linkname = p.parseString(v7.LinkName())
489 hdr.Uname = p.parseString(ustar.UserName())
490 hdr.Gname = p.parseString(ustar.GroupName())
491 if hdr.Typeflag == TypeChar || hdr.Typeflag == TypeBlock {
492 hdr.Devmajor = p.parseNumeric(ustar.DevMajor())
493 hdr.Devminor = p.parseNumeric(ustar.DevMinor())
504 hdr.AccessTime = time.Unix(p.parseNumeric(star.AccessTime()), 0)
505 hdr.ChangeTime = time.Unix(p.parseNumeric(star.ChangeTime()), 0)
508 hdr.AccessTime = tryParseTime(gnu.AccessTime())
509 hdr.ChangeTime = tryParseTime(gnu.ChangeTime())
512 hdr.Name = prefix + "/" + hdr.Name
515 return hdr, &tr.blk, p.err
526 func (tr *Reader) readOldGNUSparseMap(hdr *Header, blk *block) ([]sparseEntry, error) {
535 hdr.Size = p.parseNumeric(blk.GNU().RealSize())