1ARCHIVE_READ_FORMAT(3)   BSD Library Functions Manual   ARCHIVE_READ_FORMAT(3)
2

NAME

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‐
12     chives
13

LIBRARY

15     Streaming Archive Library (libarchive, -larchive)
16

SYNOPSIS

18     #include <archive.h>
19
20     int
21     archive_read_support_format_7zip(struct archive *);
22
23     int
24     archive_read_support_format_all(struct archive *);
25
26     int
27     archive_read_support_format_ar(struct archive *);
28
29     int
30     archive_read_support_format_by_code(struct archive *, int);
31
32     int
33     archive_read_support_format_cab(struct archive *);
34
35     int
36     archive_read_support_format_cpio(struct archive *);
37
38     int
39     archive_read_support_format_empty(struct archive *);
40
41     int
42     archive_read_support_format_iso9660(struct archive *);
43
44     int
45     archive_read_support_format_lha(struct archive *);
46
47     int
48     archive_read_support_format_mtree(struct archive *);
49
50     int
51     archive_read_support_format_rar(struct archive *);
52
53     int
54     archive_read_support_format_raw(struct archive *);
55
56     int
57     archive_read_support_format_tar(struct archive *);
58
59     int
60     archive_read_support_format_xar(struct archive *);
61
62     int
63     archive_read_support_format_zip(struct archive *);
64

DESCRIPTION

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
84             (see below).
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
93             using this function.
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.
107

RETURN VALUES

109     These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.
110

ERRORS

112     Detailed error codes and textual descriptions are available from the
113     archive_errno() and archive_error_string() functions.
114

SEE ALSO

116     tar(1), archive_read_data(3), archive_read_filter(3),
117     archive_read_set_options(3), archive_util(3), libarchive(3), tar(5)
118

BUGS

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.
125
126     Using the “raw” handler together with any other handler will often work
127     but can produce surprising results.
128
129BSD                            February 2, 2012                            BSD
Impressum