| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"/> |
| <style> |
| table.head, table.foot { width: 100%; } |
| td.head-rtitle, td.foot-os { text-align: right; } |
| td.head-vol { text-align: center; } |
| div.Pp { margin: 1ex 0ex; } |
| </style> |
| <link rel="stylesheet" href="../nih-man.css" type="text/css" media="all"/> |
| <title>ZIP_FDOPEN(3)</title> |
| </head> |
| <body> |
| <table class="head"> |
| <tr> |
| <td class="head-ltitle">ZIP_FDOPEN(3)</td> |
| <td class="head-vol">Library Functions Manual</td> |
| <td class="head-rtitle">ZIP_FDOPEN(3)</td> |
| </tr> |
| </table> |
| <div class="manual-text"> |
| <h1 class="Sh" id="NAME">NAME</h1> |
| <b class="Nm">zip_fdopen</b> — <span class="Nd">open zip archive using |
| open file descriptor</span> |
| <h1 class="Sh" id="LIBRARY">LIBRARY</h1> |
| libzip (-lzip) |
| <h1 class="Sh" id="SYNOPSIS">SYNOPSIS</h1> |
| <b class="In">#include <<a class="In">zip.h</a>></b> |
| <div class="Pp"></div> |
| <var class="Ft">zip_t *</var> |
| <br/> |
| <b class="Fn">zip_fdopen</b>(<var class="Fa" style="white-space: nowrap;">int |
| fd</var>, <var class="Fa" style="white-space: nowrap;">int flags</var>, |
| <var class="Fa" style="white-space: nowrap;">int *errorp</var>); |
| <h1 class="Sh" id="DESCRIPTION">DESCRIPTION</h1> |
| The zip archive specified by the open file descriptor <var class="Ar">fd</var> |
| is opened and a pointer to a <var class="Ft">struct zip</var>, used to |
| manipulate the archive, is returned. In contrast to |
| <a class="Xr" href="zip_open.html">zip_open(3)</a>, using |
| <b class="Nm">zip_fdopen</b> the archive can only be opened in read-only mode. |
| The <var class="Ar">fd</var> argument may not be used any longer after calling |
| <b class="Nm">zip_fdopen</b>. The <var class="Fa">flags</var> are specified by |
| <i class="Em">or</i><span class="No">'ing</span> the following values, or 0 |
| for none of them. |
| <div class="Bl-tag" style="margin-left: 6.00ex;"> |
| <dl class="Bl-tag" style="margin-left: 13.00ex;"> |
| <dt class="It-tag" style="margin-left: -13.00ex;"> </dt> |
| <dd class="It-tag"> </dd> |
| <dt class="It-tag" style="margin-left: -13.00ex;"><code class="Dv">ZIP_CHECKCONS</code></dt> |
| <dd class="It-tag">Perform additional stricter consistency checks on the |
| archive, and error if they fail.</dd> |
| </dl> |
| </div> |
| <div class="Pp"></div> |
| If an error occurs and <var class="Ar">errorp</var> is |
| <span class="No">non-</span><code class="Dv">NULL</code>, it will be set to |
| the corresponding error code. |
| <h1 class="Sh" id="RETURN_VALUES">RETURN VALUES</h1> |
| Upon successful completion <b class="Fn">zip_fdopen</b>() returns a |
| <var class="Ft">struct zip</var> pointer, and <var class="Ar">fd</var> should |
| not be used any longer, nor passed to |
| <a class="Xr" href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html">close(2)</a>. Otherwise, |
| <code class="Dv">NULL</code> is returned and <var class="Ar">*errorp</var> is |
| set to indicate the error. In the error case, <var class="Ar">fd</var> remains |
| unchanged. |
| <h1 class="Sh" id="ERRORS">ERRORS</h1> |
| The file specified by <var class="Ar">fd</var> is prepared for use by |
| <a class="Xr" href="libzip.html">libzip(3)</a> unless: |
| <dl class="Bl-tag" style="margin-left: 17.00ex;"> |
| <dt class="It-tag" style="margin-left: -17.00ex;"> </dt> |
| <dd class="It-tag"> </dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;">[<code class="Er">ZIP_ER_INCONS</code>]</dt> |
| <dd class="It-tag">Inconsistencies were found in the file specified by |
| <var class="Ar">path</var>. This error is often caused by specifying |
| <code class="Dv">ZIP_CHECKCONS</code> but can also happen without it.</dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;"> </dt> |
| <dd class="It-tag"> </dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;">[<code class="Er">ZIP_ER_INVAL</code>]</dt> |
| <dd class="It-tag">The <var class="Ar">flags</var> argument is invalid. Not |
| all <a class="Xr" href="zip_open.html">zip_open(3)</a> flags are allowed |
| for <b class="Nm">zip_fdopen</b>, see |
| <a class="Sx" href="#DESCRIPTION">DESCRIPTION</a>.</dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;"> </dt> |
| <dd class="It-tag"> </dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;">[<code class="Er">ZIP_ER_MEMORY</code>]</dt> |
| <dd class="It-tag">Required memory could not be allocated.</dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;"> </dt> |
| <dd class="It-tag"> </dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;">[<code class="Er">ZIP_ER_NOZIP</code>]</dt> |
| <dd class="It-tag">The file specified by <var class="Ar">fd</var> is not a zip |
| archive.</dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;"> </dt> |
| <dd class="It-tag"> </dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;">[<code class="Er">ZIP_ER_OPEN</code>]</dt> |
| <dd class="It-tag">The file specified by <var class="Ar">fd</var> could not be |
| prepared for use by <a class="Xr" href="libzip.html">libzip(3)</a>.</dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;"> </dt> |
| <dd class="It-tag"> </dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;">[<code class="Er">ZIP_ER_READ</code>]</dt> |
| <dd class="It-tag">A read error occurred; see <var class="Va">errno</var> for |
| details.</dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;"> </dt> |
| <dd class="It-tag"> </dd> |
| <dt class="It-tag" style="margin-left: -17.00ex;">[<code class="Er">ZIP_ER_SEEK</code>]</dt> |
| <dd class="It-tag">The file specified by <var class="Ar">fd</var> does not |
| allow seeks.</dd> |
| </dl> |
| <h1 class="Sh" id="SEE_ALSO">SEE ALSO</h1> |
| <a class="Xr" href="libzip.html">libzip(3)</a>, |
| <a class="Xr" href="zip_close.html">zip_close(3)</a>, |
| <a class="Xr" href="zip_error_to_str.html">zip_error_to_str(3)</a>, |
| <a class="Xr" href="zip_open.html">zip_open(3)</a> |
| <h1 class="Sh" id="HISTORY">HISTORY</h1> |
| <b class="Fn">zip_fdopen</b>() was added in libzip 1.0. |
| <h1 class="Sh" id="AUTHORS">AUTHORS</h1> |
| <span class="An">Dieter Baron</span> |
| <<a class="Mt" href="mailto:dillo@nih.at">dillo@nih.at</a>> and |
| <span class="An">Thomas Klausner</span> |
| <<a class="Mt" href="mailto:tk@giga.or.at">tk@giga.or.at</a>></div> |
| <table class="foot"> |
| <tr> |
| <td class="foot-date">December 18, 2017</td> |
| <td class="foot-os">NetBSD 8.99.14</td> |
| </tr> |
| </table> |
| </body> |
| </html> |