summaryrefslogtreecommitdiff
path: root/libgo/go/archive/tar/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/archive/tar/common.go')
-rw-r--r--libgo/go/archive/tar/common.go51
1 files changed, 26 insertions, 25 deletions
diff --git a/libgo/go/archive/tar/common.go b/libgo/go/archive/tar/common.go
index 52885876589..67355086a63 100644
--- a/libgo/go/archive/tar/common.go
+++ b/libgo/go/archive/tar/common.go
@@ -15,36 +15,37 @@ const (
blockSize = 512
// Types
- TypeReg = '0'
- TypeRegA = '\x00'
- TypeLink = '1'
- TypeSymlink = '2'
- TypeChar = '3'
- TypeBlock = '4'
- TypeDir = '5'
- TypeFifo = '6'
- TypeCont = '7'
- TypeXHeader = 'x'
- TypeXGlobalHeader = 'g'
+ TypeReg = '0' // regular file.
+ TypeRegA = '\x00' // regular file.
+ TypeLink = '1' // hard link.
+ TypeSymlink = '2' // symbolic link.
+ TypeChar = '3' // character device node.
+ TypeBlock = '4' // block device node.
+ TypeDir = '5' // directory.
+ TypeFifo = '6' // fifo node.
+ TypeCont = '7' // reserved.
+ TypeXHeader = 'x' // extended header.
+ TypeXGlobalHeader = 'g' // global extended header.
)
// A Header represents a single header in a tar archive.
// Some fields may not be populated.
type Header struct {
- Name string
- Mode int64
- Uid int
- Gid int
- Size int64
- Mtime int64
- Typeflag byte
- Linkname string
- Uname string
- Gname string
- Devmajor int64
- Devminor int64
- Atime int64
- Ctime int64
+ Name string // name of header file entry.
+ Mode int64 // permission and mode bits.
+ Uid int // user id of owner.
+ Gid int // group id of owner.
+ Size int64 // length in bytes.
+ Mtime int64 // modified time; seconds since epoch.
+ Typeflag byte // type of header entry.
+ Linkname string // target name of link.
+ Uname string // user name of owner.
+ Gname string // group name of owner.
+ Devmajor int64 // major number of character or block device.
+ Devminor int64 // minor number of character or block device.
+ Atime int64 // access time; seconds since epoch.
+ Ctime int64 // status change time; seconds since epoch.
+
}
var zeroBlock = make([]byte, blockSize)