Commit | Line | Data |
---|---|---|
d012942d KB |
1 | .\" @(#)cpioformat.5 5.2 (Berkeley) %G% |
2 | .\" | |
3 | .TH CPIO 5 "" | |
4 | .UC 7 | |
5 | .SH NAME | |
1b927a87 | 6 | cpio - format of cpio archive |
d012942d | 7 | .SH DESCRIPTION |
1b927a87 | 8 | The header structure, when the -c option of cpio(1) is not used, is: |
d012942d KB |
9 | .sp 1 |
10 | .nf | |
11 | struct { | |
12 | short h_magic, | |
13 | h_dev; | |
14 | ushort h_ino, | |
15 | h_mode, | |
16 | h_uid, | |
17 | h_gid; | |
18 | short h_nlink, | |
19 | h_rdev, | |
20 | h_mtime[2], | |
21 | h_namesize, | |
22 | h_filesize[2]; | |
23 | char h_name[h_namesize rounded to word]; | |
24 | } Hdr; | |
25 | .sp 2 | |
26 | When the -c option is used, the header information is described by: | |
1b927a87 | 27 | .sp |
d012942d KB |
28 | sscanf(Chdr,"%6o%6o%6o%6o%6o%6o%6o%6o%11lo%6o%11lo%s", |
29 | &Hdr.h_magic, &Hdr.h_dev, &Hdr.h_ino, &Hdr.h_mode, | |
30 | &Hdr.h_uid, &Hdr.h_gid, &Hdr.h_nlink, &Hdr.h_rdev, | |
31 | &Longtime, &Hdr.h_namesize,&Longfile,Hdr.h_name); | |
32 | .fi | |
1b927a87 | 33 | .sp |
1b927a87 KB |
34 | Longtime and Longfile are equivalent to Hdr.h_mtime and |
35 | Hdr.h_filesize, respectively. The contents of each file are | |
36 | recorded in an element of the array of varying lenght | |
37 | structures, archive, together with other items describing | |
38 | the file. Every instance of h_magic contains the constant | |
d012942d | 39 | 070707 (octal). The itimes h_dev through h_mtime have |
1b927a87 KB |
40 | meanings explained in stat(2). The length of the null- |
41 | terminated path name H_name, icluding the null byte, is | |
42 | given by h_namesize. | |
43 | .sp | |
44 | The last record of the archive always contains the name | |
45 | TRAILER!!!. Special files, directories, and the trailer are | |
46 | recorded with H_filesize equal to zero. | |
d012942d KB |
47 | .SH SEE ALSO |
48 | cpio(1), find(1), stat(2) |