Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Package tar implements access to tar archives. | 5 // Package tar implements access to tar archives. |
6 // It aims to cover most of the variations, including those produced | 6 // It aims to cover most of the variations, including those produced |
7 // by GNU and BSD tars. | 7 // by GNU and BSD tars. |
8 // | 8 // |
9 // References: | 9 // References: |
10 // http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5 | 10 // http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 Typeflag byte // type of header entry | 50 Typeflag byte // type of header entry |
51 Linkname string // target name of link | 51 Linkname string // target name of link |
52 Uname string // user name of owner | 52 Uname string // user name of owner |
53 Gname string // group name of owner | 53 Gname string // group name of owner |
54 Devmajor int64 // major number of character or block device | 54 Devmajor int64 // major number of character or block device |
55 Devminor int64 // minor number of character or block device | 55 Devminor int64 // minor number of character or block device |
56 AccessTime time.Time // access time | 56 AccessTime time.Time // access time |
57 ChangeTime time.Time // status change time | 57 ChangeTime time.Time // status change time |
58 } | 58 } |
59 | 59 |
60 // Some standard field sizes | 60 // File name constants from the tar spec. |
61 const ( | 61 const ( |
62 » FileNameSize = 100 | 62 » fileNameSize = 100 // Maximum number of bytes in a standard tar na me. |
dsymonds
2013/02/07 04:16:27
these don't need to be exported. they could also d
shanemhansen
2013/02/07 04:35:43
Done.
| |
63 » FileNamePrefixSize = 155 | 63 » fileNamePrefixSize = 155 // Maximum number of ustar extension bytes. |
64 ) | 64 ) |
65 | 65 |
66 // sysStat, if non-nil, populates h from system-dependent fields of fi. | 66 // sysStat, if non-nil, populates h from system-dependent fields of fi. |
67 var sysStat func(fi os.FileInfo, h *Header) error | 67 var sysStat func(fi os.FileInfo, h *Header) error |
68 | 68 |
69 // Mode constants from the tar spec. | 69 // Mode constants from the tar spec. |
70 const ( | 70 const ( |
71 c_ISDIR = 040000 | 71 c_ISDIR = 040000 |
72 c_ISFIFO = 010000 | 72 c_ISFIFO = 010000 |
73 c_ISREG = 0100000 | 73 c_ISREG = 0100000 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 return | 138 return |
139 } | 139 } |
140 | 140 |
141 type slicer []byte | 141 type slicer []byte |
142 | 142 |
143 func (sp *slicer) next(n int) (b []byte) { | 143 func (sp *slicer) next(n int) (b []byte) { |
144 s := *sp | 144 s := *sp |
145 b, *sp = s[0:n], s[n:] | 145 b, *sp = s[0:n], s[n:] |
146 return | 146 return |
147 } | 147 } |
LEFT | RIGHT |