home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.11 / text0013.txt < prev    next >
Encoding:
Text File  |  1987-07-18  |  1.7 KB  |  60 lines

  1.  
  2. N.048    April 15, 1987    ``a proposal for a cpio format to be added to
  3. Chapter 10,'' Lorraine C. Kevra, AT&T.
  4.  
  5. Secretary, IEEE Standards Board:
  6.  
  7. The attached is a proposal for a cpio format to be added to Chapter 10
  8. (Data Interchange Format) of the POSIX Standard.
  9.  
  10.                         Lorraine C. Kevra
  11.  
  12. NAME
  13.     cpio - format of cpio archive
  14.  
  15. DESCRIPTION
  16.     The *header* structure, when the -c option of *cpio*(1) is not used, is:
  17.  
  18.         struct {
  19.             short    h_magic,
  20.                 h_dev;
  21.             ushort    h_ino,
  22.                 h_mode,
  23.                 h_uid,
  24.                 h_gid;
  25.             short    h_nlink,
  26.                 h_rdev,
  27.                 h_mtime[2],
  28.                 h_namesize,
  29.                 h_filesize[2],
  30.             char    h_name[h_namesize rounded to word];
  31.         } Hdr;
  32.  
  33.     When the -c option is used, the *header* information is described by:
  34.  
  35.         sscanf(Chdr,"%6o%6o%6o%6o%6o%6o%6o%6o%11lo%6o%11lo%s",
  36.             &Hdr.h_magic,&Hdr.h_dev,&Hdr.h_ino,&Hdr.h_mode,
  37.             &Hdr.h_uid,&Hdr.h_gid,&Hdr.h_nlink,&Hdr.h_rdev,
  38.             &Longtime,&Hdr.h_namesize,&Longfile,&Hdr.h_name);
  39.  
  40.     *Longtime* and *Longfile* are equivalent to *Hdr.h_mtime* and
  41.     *Hdr.h_filesize*, respectively.  The contents of each file are
  42.     recorded in an element of the array of varying length structures,
  43.     *archive*, together with other items describeing the file.
  44.     Every instance of *h_magic* contains the constant 070707
  45.     (octal).  The items *h_dev* through *h_mtime* have meanings
  46.     explained in *stat*(2).  The length of the null-terminated path
  47.     name *h_name*, including the null byte, is given by
  48.     *h_namesize*.
  49.  
  50.     The last record of the *archive* always contains the name TRAILER!!!.
  51.     Special files, directories, and the trailer are recorded with
  52.     *h_filesize* equal to zero.
  53.  
  54. SEE ALSO
  55.     stat(2) in the *Programmer's Reference Manual*.
  56.     cpio(1), find(1) in the *User's Reference Manual*.
  57.  
  58. Volume-Number: Volume 11, Number 14
  59.  
  60.