1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
.TH CPIO 5
.CT 1 comm_users
.SH NAME
cpio \- format of cpio archive
.SH DESCRIPTION
The archived files are recorded consecutively, each
preceded by a
.BR header .
The header
structure, when the
.B \-c
option of
.IR cpio (1)
is not used, is:
.PP
.EX
.ta \w'short 'u +\w'ushort 'u
typdef unsigned short ushort;
struct {
short h_magic,
h_dev;
ushort h_ino,
h_mode,
h_uid,
h_gid;
short h_nlink,
h_rdev,
h_mtime[2],
h_namesize,
h_filesize[2];
char h_name[h_namesize rounded to word];
} Hdr;
.EE
.PP
When the
.B \-c
option is used, the
.B header
information is printable, as described by the
.IR printf (3)
call
.IP
.EX
printf(Chdr, "%6o%6o%6o%6o%6o%6o%6o%6o%11lo%6o%11lo%s",
Hdr.h_magic, Hdr.h_dev, Hdr.h_ino, Hdr.h_mode,
Hdr.h_uid, Hdr.h_gid, Hdr.h_nlink, Hdr.h_rdev,
Longtime, Hdr.h_namesize, Longfile, Hdr.h_name
.EE
.PP
.L Longtime
and
.L Longfile
are equivalent to
.L Hdr.h_mtime
and
.LR Hdr.h_filesize ,
respectively.
Every instance of
.L h_magic
contains the octal constant
.LR 070707 .
The items
.L h_dev
through
.L h_mtime
have meanings explained in
.IR stat (2).
The length of the null-terminated path name
.LR h_name ,
including the null byte,
is given by
.LR h_namesize .
.PP
The last element
of the archive
is a dummy entry for the name
.BR TRAILER!!! ,
with padding to a multiple of 512 bytes.
Special files, directories, and the trailer are recorded
with
.L h_filesize
equal to zero.
.SH "SEE ALSO"
.IR cpio (1),
.IR find (1),
.IR stat (2).
.\" @(#)cpio.4 5.2 of 5/18/82
|