ManPageArchiveReadFormat3.wiki 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. ARCHIVE_READ_FORMAT(3) manual page
  2. == NAME ==
  3. '''archive_read_support_format_7zip''',
  4. '''archive_read_support_format_all''',
  5. '''archive_read_support_format_ar''',
  6. '''archive_read_support_format_by_code''',
  7. '''archive_read_support_format_cab''',
  8. '''archive_read_support_format_cpio''',
  9. '''archive_read_support_format_empty''',
  10. '''archive_read_support_format_iso9660''',
  11. '''archive_read_support_format_lha''',
  12. '''archive_read_support_format_mtree''',
  13. '''archive_read_support_format_rar''',
  14. '''archive_read_support_format_raw''',
  15. '''archive_read_support_format_tar''',
  16. '''archive_read_support_format_xar''',
  17. '''archive_read_support_format_zip'''
  18. - functions for reading streaming archives
  19. == LIBRARY ==
  20. Streaming Archive Library (libarchive, -larchive)
  21. == SYNOPSIS ==
  22. '''<nowiki>#include <archive.h></nowiki>'''
  23. <br>
  24. ''int''
  25. <br>
  26. '''archive_read_support_format_7zip'''(''struct archive *'');
  27. <br>
  28. ''int''
  29. <br>
  30. '''archive_read_support_format_all'''(''struct archive *'');
  31. <br>
  32. ''int''
  33. <br>
  34. '''archive_read_support_format_ar'''(''struct archive *'');
  35. <br>
  36. ''int''
  37. <br>
  38. '''archive_read_support_format_by_code'''(''struct archive *'', ''int'');
  39. <br>
  40. ''int''
  41. <br>
  42. '''archive_read_support_format_cab'''(''struct archive *'');
  43. <br>
  44. ''int''
  45. <br>
  46. '''archive_read_support_format_cpio'''(''struct archive *'');
  47. <br>
  48. ''int''
  49. <br>
  50. '''archive_read_support_format_empty'''(''struct archive *'');
  51. <br>
  52. ''int''
  53. <br>
  54. '''archive_read_support_format_iso9660'''(''struct archive *'');
  55. <br>
  56. ''int''
  57. <br>
  58. '''archive_read_support_format_lha'''(''struct archive *'');
  59. <br>
  60. ''int''
  61. <br>
  62. '''archive_read_support_format_mtree'''(''struct archive *'');
  63. <br>
  64. ''int''
  65. <br>
  66. '''archive_read_support_format_rar'''(''struct archive *'');
  67. <br>
  68. ''int''
  69. <br>
  70. '''archive_read_support_format_raw'''(''struct archive *'');
  71. <br>
  72. ''int''
  73. <br>
  74. '''archive_read_support_format_tar'''(''struct archive *'');
  75. <br>
  76. ''int''
  77. <br>
  78. '''archive_read_support_format_xar'''(''struct archive *'');
  79. <br>
  80. ''int''
  81. <br>
  82. '''archive_read_support_format_zip'''(''struct archive *'');
  83. == DESCRIPTION ==
  84. <dl>
  85. <dt>
  86. '''archive_read_support_format_7zip'''(),
  87. '''archive_read_support_format_ar'''(),
  88. '''archive_read_support_format_cab'''(),
  89. '''archive_read_support_format_cpio'''(),
  90. '''archive_read_support_format_iso9660'''(),
  91. '''archive_read_support_format_lha'''(),
  92. '''archive_read_support_format_mtree'''(),
  93. '''archive_read_support_format_rar'''(),
  94. '''archive_read_support_format_raw'''(),
  95. '''archive_read_support_format_tar'''(),
  96. '''archive_read_support_format_xar'''(),
  97. '''archive_read_support_format_zip'''()
  98. </dt> <dd>
  99. Enables support---including auto-detection code---for the
  100. specified archive format.
  101. For example,
  102. '''archive_read_support_format_tar'''()
  103. enables support for a variety of standard tar formats, old-style tar,
  104. ustar, pax interchange format, and many common variants.
  105. </dd><dt>'''archive_read_support_format_all'''()</dt><dd>
  106. Enables support for all available formats except the
  107. "raw"
  108. format (see below).
  109. </dd><dt>'''archive_read_support_format_by_code'''()</dt><dd>
  110. Enables a single format specified by the format code.
  111. This can be useful when reading a single archive twice;
  112. use
  113. '''archive_format'''()
  114. after reading the first time and pass the resulting code
  115. to this function to selectively enable only the necessary
  116. format support.
  117. Note: In statically-linked executables, this will cause
  118. your program to include support for every format.
  119. If executable size is a concern, you may wish to avoid
  120. using this function.
  121. </dd><dt>'''archive_read_support_format_empty'''()</dt><dd>
  122. Enables support for treating empty files as empty archives.
  123. Because empty files are valid for several different formats,
  124. it is not possible to accurately determine a format for
  125. an empty file based purely on contents.
  126. So empty files are treated by libarchive as a distinct
  127. format.
  128. </dd><dt>'''archive_read_support_format_raw'''()</dt><dd>
  129. The
  130. "raw"
  131. format handler allows libarchive to be used to read arbitrary data.
  132. It treats any data stream as an archive with a single entry.
  133. The pathname of this entry is
  134. "data ;"
  135. all other entry fields are unset.
  136. This is not enabled by
  137. '''archive_read_support_format_all'''()
  138. in order to avoid erroneous handling of damaged archives.
  139. </dd></dl>
  140. == RETURN VALUES ==
  141. These functions return
  142. '''ARCHIVE_OK'''
  143. on success, or
  144. '''ARCHIVE_FATAL'''.
  145. == ERRORS ==
  146. Detailed error codes and textual descriptions are available from the
  147. '''archive_errno'''()
  148. and
  149. '''archive_error_string'''()
  150. functions.
  151. == SEE ALSO ==
  152. [[ManPageBsdtar1]],
  153. [[ManPageArchiveReadData3]],
  154. [[ManPageArchiveReadFilter3]],
  155. [[ManPageArchiveReadSetOptions3]],
  156. [[ManPageArchiveUtil3]],
  157. [[ManPageLibarchive3]],
  158. [[ManPageTar5]]
  159. == BUGS ==
  160. Many traditional archiver programs treat
  161. empty files as valid empty archives.
  162. For example, many implementations of
  163. [[ManPageBsdtar1]]
  164. allow you to append entries to an empty file.
  165. Of course, it is impossible to determine the format of an empty file
  166. by inspecting the contents, so this library treats empty files as
  167. having a special
  168. "empty"
  169. format.
  170. Using the
  171. "raw"
  172. handler together with any other handler will often work
  173. but can produce surprising results.