1*49634Scael.\" Copyright 1991 The Regents of the University of California. 2*49634Scael.\" All rights reserved. 333836Sbostic.\" 4*49634Scael.\" %sccs.include.redist.roff% 5*49634Scael.\" 6*49634Scael.\" @(#)cpioformat.5 5.3 (Berkeley) 05/10/91 7*49634Scael.\" 8*49634Scael.Dd 9*49634Scael.Dt CPIO 5 10*49634Scael.Os 11*49634Scael.Sh NAME 12*49634Scael.Nm cpio 13*49634Scael.Nd format of cpio archive 14*49634Scael.Sh DESCRIPTION 15*49634ScaelThe header structure, when the 16*49634Scael.Fl c 17*49634Scaeloption of 18*49634Scael.Xr cpio 1 19*49634Scaelis not used, is: 20*49634Scael.Bd -literal -offset indent 21*49634Scaelstruct { 22*49634Scael short h_magic, 23*49634Scael h_dev; 24*49634Scael ushort h_ino, 25*49634Scael h_mode, 26*49634Scael h_uid, 27*49634Scael h_gid; 28*49634Scael short h_nlink, 29*49634Scael h_rdev, 30*49634Scael h_mtime[2], 31*49634Scael h_namesize, 32*49634Scael h_filesize[2]; 33*49634Scael char h_name[h_namesize rounded to word]; 34*49634Scael} Hdr; 35*49634Scael.Ed 36*49634Scael.Pp 37*49634ScaelWhen the 38*49634Scael.Fl c 39*49634Scaeloption is used, the header information is described by: 40*49634Scael.Bd -literal -offset indent 41*49634Scaelsscanf(Chdr,"%6o%6o%6o%6o%6o%6o%6o%6o%11lo%6o%11lo%s", 42*49634Scael&Hdr.h_magic, &Hdr.h_dev, &Hdr.h_ino, &Hdr.h_mode, 43*49634Scael&Hdr.h_uid, &Hdr.h_gid, &Hdr.h_nlink, &Hdr.h_rdev, 44*49634Scael&Longtime, &Hdr.h_namesize,&Longfile,Hdr.h_name); 45*49634Scael.Ed 46*49634Scael.Pp 47*49634Scael.Fa Longtime 48*49634Scaeland 49*49634Scael.Fa Longfile 50*49634Scaelare equivalent to 51*49634Scael.Fa Hdr.h_mtime 52*49634Scaeland 53*49634Scael.Fa Hdr.h_filesize , 54*49634Scaelrespectively. 55*49634ScaelThe contents of each file are 5633833Sbosticrecorded in an element of the array of varying lenght 5733833Sbosticstructures, archive, together with other items describing 58*49634Scaelthe file. 59*49634ScaelEvery instance of 60*49634Scael.Fa h_magic 61*49634Scaelcontains the constant 62*49634Scael070707 (octal). 63*49634ScaelThe itimes 64*49634Scael.Fa h_dev 65*49634Scaelthrough 66*49634Scael.Fa h_mtime 67*49634Scaelhave 68*49634Scaelmeanings explained in 69*49634Scael.Xr stat 2 . 70*49634ScaelThe length of the null-terminated path name 71*49634Scael.Fa H_name , 72*49634Scaelicluding the null byte, is 73*49634Scaelgiven by 74*49634Scael.Fa h_namesize . 75*49634Scael.Pp 7633833SbosticThe last record of the archive always contains the name 7733833SbosticTRAILER!!!. Special files, directories, and the trailer are 78*49634Scaelrecorded with 79*49634Scael.Fa H_filesize 80*49634Scaelequal to zero. 81*49634Scael.Sh SEE ALSO 82*49634Scael.Xr cpio 1 , 83*49634Scael.Xr find 1 , 84*49634Scael.Xr stat 2 85*49634Scael.Sh HISTORY 86*49634ScaelA 87*49634Scael.Xr cpio 1 88*49634Scaelcommand appeared in 89*49634Scael.At V . 90*49634ScaelThis file format is derived from the 91*49634Scael.At V 92*49634Scaelsources which were contributed to the public domain by AT&T. 93