new copyright notice
[unix-history] / usr / src / old / cpio / cpioformat.5
CommitLineData
d012942d
KB
1.\" @(#)cpioformat.5 5.2 (Berkeley) %G%
2.\"
3.TH CPIO 5 ""
4.UC 7
5.SH NAME
1b927a87 6cpio - format of cpio archive
d012942d 7.SH DESCRIPTION
1b927a87 8The 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
26When 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
34Longtime and Longfile are equivalent to Hdr.h_mtime and
35Hdr.h_filesize, respectively. The contents of each file are
36recorded in an element of the array of varying lenght
37structures, archive, together with other items describing
38the file. Every instance of h_magic contains the constant
d012942d 39070707 (octal). The itimes h_dev through h_mtime have
1b927a87
KB
40meanings explained in stat(2). The length of the null-
41terminated path name H_name, icluding the null byte, is
42given by h_namesize.
43.sp
44The last record of the archive always contains the name
45TRAILER!!!. Special files, directories, and the trailer are
46recorded with H_filesize equal to zero.
d012942d
KB
47.SH SEE ALSO
48cpio(1), find(1), stat(2)