| 1 | module tar |
| 2 | |
| 3 | // ustart header block octets |
| 4 | // Field | Offset | Length |
| 5 | // -------------------------- |
| 6 | // name | 0 | 100 |
| 7 | // mode | 100 | 8 |
| 8 | // uid | 108 | 8 |
| 9 | // gid | 116 | 8 |
| 10 | // size | 124 | 12 |
| 11 | // mtime | 136 | 12 |
| 12 | // chksum | 148 | 8 |
| 13 | // typeflag | 156 | 1 |
| 14 | // linkname | 157 | 100 |
| 15 | // magic | 257 | 6 |
| 16 | // version | 263 | 2 |
| 17 | // uname | 265 | 32 |
| 18 | // gname | 297 | 32 |
| 19 | // devmajor | 329 | 8 |
| 20 | // devminor | 337 | 8 |
| 21 | // prefix | 345 | 155 |
| 22 | |
| 23 | pub enum BlockHeader as u8 { |
| 24 | file = u8(`0`) // 0x30 |
| 25 | hard_link = u8(`1`) // 0x31 |
| 26 | sym_link = u8(`2`) // 0x32 |
| 27 | char_dev = u8(`3`) // 0x33 |
| 28 | block_dev = u8(`4`) // 0x34 |
| 29 | dir = u8(`5`) // 0x35 |
| 30 | fifo = u8(`6`) // 0x36 |
| 31 | long_name = u8(`L`) // 0x4c = 76 dec |
| 32 | global = u8(`g`) // 0x67 pax |
| 33 | } |
| 34 | |
| 35 | pub enum BlockSpecial { |
| 36 | no // for headers `0`,`5` or data blocks |
| 37 | blank_1 // first blank block: continue |
| 38 | blank_2 // second blank block: end of archiv |
| 39 | ignore // for headers `1`, `2`, `3`, `4`, `6` |
| 40 | long_name // for header `L` |
| 41 | global // for header `g` |
| 42 | unknown // for not header defined |
| 43 | } |
| 44 | |