1 ARCHIVE_READ_FORMAT(3) BSD Library Functions Manual ARCHIVE_READ_FORMAT(3)
4 archive_read_support_format_7zip, archive_read_support_format_all,
5 archive_read_support_format_ar, archive_read_support_format_by_code,
6 archive_read_support_format_cab, archive_read_support_format_cpio,
7 archive_read_support_format_empty, archive_read_support_format_iso9660,
8 archive_read_support_format_lha, archive_read_support_format_mtree,
9 archive_read_support_format_rar, archive_read_support_format_raw,
10 archive_read_support_format_tar, archive_read_support_format_xar,
11 archive_read_support_format_zip — functions for reading streaming ar‐
15 Streaming Archive Library (libarchive, -larchive)
21 archive_read_support_format_7zip(struct archive *);
24 archive_read_support_format_all(struct archive *);
27 archive_read_support_format_ar(struct archive *);
30 archive_read_support_format_by_code(struct archive *, int);
33 archive_read_support_format_cab(struct archive *);
36 archive_read_support_format_cpio(struct archive *);
39 archive_read_support_format_empty(struct archive *);
42 archive_read_support_format_iso9660(struct archive *);
45 archive_read_support_format_lha(struct archive *);
48 archive_read_support_format_mtree(struct archive *);
51 archive_read_support_format_rar(struct archive *);
54 archive_read_support_format_raw(struct archive *);
57 archive_read_support_format_tar(struct archive *);
60 archive_read_support_format_xar(struct archive *);
63 archive_read_support_format_zip(struct archive *);
66 archive_read_support_format_7zip(), archive_read_support_format_ar(),
67 archive_read_support_format_cab(),
68 archive_read_support_format_cpio(),
69 archive_read_support_format_iso9660(),
70 archive_read_support_format_lha(),
71 archive_read_support_format_mtree(),
72 archive_read_support_format_rar(),
73 archive_read_support_format_raw(),
74 archive_read_support_format_tar(),
75 archive_read_support_format_xar(),
76 archive_read_support_format_zip()
77 Enables support---including auto-detection code---for the speci‐
78 fied archive format. For example,
79 archive_read_support_format_tar() enables support for a variety
80 of standard tar formats, old-style tar, ustar, pax interchange
81 format, and many common variants.
82 archive_read_support_format_all()
83 Enables support for all available formats except the “raw” format
85 archive_read_support_format_by_code()
86 Enables a single format specified by the format code. This can
87 be useful when reading a single archive twice; use
88 archive_format() after reading the first time and pass the
89 resulting code to this function to selectively enable only the
90 necessary format support. Note: In statically-linked executa‐
91 bles, this will cause your program to include support for every
92 format. If executable size is a concern, you may wish to avoid
94 archive_read_support_format_empty()
95 Enables support for treating empty files as empty archives.
96 Because empty files are valid for several different formats, it
97 is not possible to accurately determine a format for an empty
98 file based purely on contents. So empty files are treated by
99 libarchive as a distinct format.
100 archive_read_support_format_raw()
101 The “raw” format handler allows libarchive to be used to read
102 arbitrary data. It treats any data stream as an archive with a
103 single entry. The pathname of this entry is “data”; all other
104 entry fields are unset. This is not enabled by
105 archive_read_support_format_all() in order to avoid erroneous
106 handling of damaged archives.
109 These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.
112 Detailed error codes and textual descriptions are available from the
113 archive_errno() and archive_error_string() functions.
116 tar(1), libarchive(3), archive_read_data(3), archive_read_filter(3),
117 archive_read_set_options(3), archive_util(3), tar(5)
120 Many traditional archiver programs treat empty files as valid empty ar‐
121 chives. For example, many implementations of tar(1) allow you to append
122 entries to an empty file. Of course, it is impossible to determine the
123 format of an empty file by inspecting the contents, so this library
124 treats empty files as having a special “empty” format.
126 Using the “raw” handler together with any other handler will often work
127 but can produce surprising results.
129 BSD February 2, 2012 BSD