home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / std_unix / volume.12 / text0011.txt < prev    next >
Encoding:
Internet Message Format  |  1989-01-07  |  7.5 KB

  1. From: attunix!kevra (Lorraine Kevra)
  2.  
  3. [ This is the current cpio proposal for 1003.1  -mod ]
  4.  
  5.  
  6.  
  7. FOR COMPUTER ENVIRONMENTS        Std 1003.1-Draft 11
  8.  
  9.  
  10.  
  11. Editor's Note: The following section has been proposed as a   b
  12. replacement for, or an addition to, the previous section.     b
  13. The small group that considered the issue at the June 1987    b
  14. meeting determined that indications were needed on how to     b
  15. extend this subsection to account for at least the following  b
  16. items:                                  b
  17.  
  18.      o+ symbolic links                    b
  19.  
  20.      o+ contiguous files                    b
  21.  
  22.      o+ file name length                    b
  23.  
  24.      o+ i-node number size                    b
  25.  
  26. There is a possibility that these concerns may be addressed   b
  27. by text in the Rationale, rather than in the body of the      b
  28. standard.                              b
  29.  
  30.  
  31. 10.3.1    cpio Archive Format                       b
  32. The byte-oriented cpio archive format is a series of          b
  33. entries, each comprised of a header that describes the file,  b
  34. the name of the file, and then the contents of the file.      b
  35.  
  36. An archive may be recorded as a series of fixed size blocks   b
  37. of bytes.  This blocking shall be used only to make physical  b
  38. I/O more efficient.  The last group of blocks is always at    b
  39. the full size.                              b
  40.  
  41. For the byte-oriented cpio archive format, the individual     b
  42. entry information must be in the order indicated and is          b
  43. described by:                              b
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.       UNAPPROVED DRAFT.     All Rights Reserved by IEEE.
  61.    Do not specify or claim conformance to this document.
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. Std 1003.1-Draft 11           PORTABLE OPERATING SYSTEM
  70.  
  71.  
  72.  
  73.          Byte-Oriented cpio Archive Entry              b
  74.               Header                  b
  75.      Field Name    Length       Interpreted as          b
  76.      __________   __________   _______________          b
  77.      c_magic       6 bytes        octal number          b
  78.      c_dev           6 bytes        octal number          b
  79.      c_ino           6 bytes        octal number          b
  80.      c_mode           6 bytes        octal number          b
  81.      c_uid           6 bytes        octal number          b
  82.      c_gid           6 bytes        octal number          b
  83.      c_nlink       6 bytes        octal number          b
  84.      c_rdev           6 bytes        octal number          b
  85.      c_mtime       11 bytes        octal number          b
  86.      c_namesize    6 bytes        octal number          b
  87.      c_filesize    11 bytes        octal number          b
  88.  
  89.              File Name                  b
  90.      Field Name    Length       Interpreted as          b
  91.      __________   __________   _______________          b
  92.      c_name          c_namesize   pathname string          b
  93.  
  94.              File Data                  b
  95.      Field Name    Length       Interpreted as          b
  96.      __________   __________   _______________          b
  97.      c_filedata   c_filesize    data              b
  98.  
  99.  22 10.3.1.1  Header                          b
  100.  23 For each file in the archive, a header as defined above     b
  101.  24 shall be written.  The information in the header fields     b
  102.  25 shall be written as streams of bytes interpreted as octal     b
  103.  26 numbers and shall be right-justified and zero filled.  The     b
  104.  27 fields shall be interpreted as follows:             b
  105.  
  106.  28    o+ c_magic shall identify the archive as being a       b
  107.  29     transportable archive by containing the magic bytes as     b
  108.  30     defined by MAGIC ("070707").                 b
  109.  
  110.  31    o+ c_dev and c_ino shall contain values which uniquely       b
  111.  32     identify the file within the archive (i.e., no files     b
  112.  33     shall contain the same pair of c_dev and c_ino values     b
  113.  34     unless they are links to the same file).  The values     b
  114.  35     shall be determined in an implementation defined     b
  115.  36     manner.                         b
  116.  
  117.  37    o+ c_mode shall contain the file type and access       b
  118.  38     permissions as defined in the tables below.         b
  119.  
  120.  
  121.  
  122.       UNAPPROVED DRAFT.     All Rights Reserved by IEEE.
  123.    Do not specify or claim conformance to this document.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. FOR COMPUTER ENVIRONMENTS        Std 1003.1-Draft 11
  132.  
  133.  
  134.  
  135.  39    o+ c_uid shall contain the user id of the owner.       b
  136.  
  137.  40    o+ c_gid shall contain the group id of the group.       b
  138.  
  139.  41    o+ c_nlink shall contain the number of links referencing   b
  140.  42     the file at the time the archive was created.         b
  141.  
  142.  43    o+ c_rdev shall contain implementation defined information b
  143.  44     for character or block special files.             b
  144.  
  145.  45    o+ c_mtime shall contain the latest time of modification   b
  146.  46     of the file.                         b
  147.  
  148.  47    o+ c_namesize shall contain the length of the path name,   b
  149.  48     including the terminating null byte.             b
  150.  
  151.  49    o+ c_filesize shall contain the length of the file.  This  b
  152.  50     is the length of the data section following the header     b
  153.  51     structure.                         b
  154.  
  155.  52 10.3.1.2  File Name                          b
  156.  53 c_name shall contain the path name of the file. The length     b
  157.  54 of the name is determined by c_namesize; the maximum length     b
  158.  55 of this string is 256 bytes.                 b
  159.  
  160.  56 10.3.1.3  File Data                          b
  161.  57 Following c_name, there shall be c_filesize bytes of data.     b
  162.  58 Interpretation of such data shall occur in a manner         b
  163.  59 dependent on the file.  If c_filesize is zero, no data shall b
  164.  60 be contained in c_filedata.                     b
  165.  
  166.  61 10.3.1.4  Special Entries                      b
  167.  62 Special files, directories, and the trailer are recorded     b
  168.  63 with c_filesize equal to zero.  The header for the next file b
  169.  64 entry in the archive shall be written directly after the     b
  170.  65 last byte of the file entry preceding it.  A header denoting b
  171.  66 the file name ``TRAILER!!!'' shall indicate the end of the     b
  172.  67 archive; the contents of bytes in the last block of the     b
  173.  68 archive following such a header are undefined.         b
  174.  
  175.  69 10.3.1.5  cpio Values                      b
  176.  70 Values needed by the cpio archive format are described as     b
  177.  71 follows:                             b
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.       UNAPPROVED DRAFT.     All Rights Reserved by IEEE.
  185.    Do not specify or claim conformance to this document.
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193. Std 1003.1-Draft 11           PORTABLE OPERATING SYSTEM
  194.  
  195.  
  196.  
  197.           Values for c_mode field              b
  198.              File permissions                  b
  199.         Name     Value      Indicates              b
  200.        _______   ______   __________________          b
  201.        C_IRUSR   000400   read by owner              b
  202.        C_IWUSR   000200   write by owner              b
  203.        C_IXUSR   000100   execute by owner              b
  204.        C_IRGRP   000040   read by group              b
  205.        C_IWGRP   000020   write by group              b
  206.        C_IXGRP   000010   execute by group              b
  207.        C_IROTH   000004   read by others              b
  208.        C_IWOTH   000002   write by others              b
  209.        C_IXOTH   000001   execute by others              b
  210.        C_ISUID   004000   set uid                  b
  211.        C_ISGID   002000   set gid                  b
  212.        C_ISVTX   001000   reserved                  b
  213.  
  214.  
  215.  
  216.           Values for c_mode field              b
  217.              File type                  b
  218.          Name     Value       Indicates              b
  219.        ________   ______   _________________          b
  220.        C_ISDIR    040000   directory              b
  221.        C_ISFIFO   010000   FIFO                  b
  222.        C_ISREG    100000   regular file              b
  223.        C_ISBLK    060000   block special              b
  224.        C_ISCHR    020000   character special          b
  225.               110000   reserved                  b
  226.               120000   reserved                  b
  227.               140000   reserved                  b
  228.  
  229. 101 C_ISDIR, C_ISFIFO, and C_ISREG shall be supported on a POSIX b
  230. 102 conforming system; additional values defined above are     b
  231. 103 reserved for compatibility with existing systems.         b
  232. 104 Additional file types may be supported; however, such files     b
  233. 105 should not be written on archives intended for transport to     b
  234. 106 portable systems.                         b
  235.  
  236. 107 10.3.1.6  References                      b
  237. 108 <grp.h> sS9.2.1, <pwd.h> sS9.2.2, <sys/stat.h> sS5.6.1, chmod() b
  238. 109 sS5.6.4, link() sS5.3.4, mkdir() sS5.4.1, read() sS6.4.1, stat() b
  239. 110 sS5.6.2.
  240. 111
  241.  
  242.  
  243.  
  244.  
  245.  
  246.       UNAPPROVED DRAFT.     All Rights Reserved by IEEE.
  247.    Do not specify or claim conformance to this document.
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255. Volume-Number: Volume 12, Number 12
  256.  
  257.