mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-25 21:38:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@297028 c90b9560-bf6c-de11-be94-00142212c4b1
120 lines
3.4 KiB
XML
120 lines
3.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.gzopen" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>gzopen</refname>
|
|
<refpurpose>Open gz-file</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>gzopen</methodname>
|
|
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter><initializer>0</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Opens a gzip (.gz) file for reading or writing.
|
|
</para>
|
|
<para>
|
|
<function>gzopen</function> can be used to read a file which is
|
|
not in gzip format; in this case <function>gzread</function> will
|
|
directly read from the file without decompression.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>filename</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The file name.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
As in <function>fopen</function> (<literal>rb</literal> or
|
|
<literal>wb</literal>) but can also include a compression level
|
|
(<literal>wb9</literal>) or a strategy: <literal>f</literal> for
|
|
filtered data as in <literal>wb6f</literal>, <literal>h</literal> for
|
|
<literal>Huffman only compression</literal> as in <literal>wb1h</literal>.
|
|
(See the description of <literal>deflateInit2</literal>
|
|
in <filename>zlib.h</filename> for
|
|
more information about the strategy parameter.)
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>use_include_path</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
You can set this optional parameter to <literal>1</literal>, if you
|
|
want to search for the file in the <link
|
|
linkend="ini.include-path">include_path</link> too.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns a file pointer to the file opened, after that, everything you read
|
|
from this file descriptor will be transparently decompressed and what you
|
|
write gets compressed.
|
|
</para>
|
|
<para>
|
|
If the open fails, the function returns &false;.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>gzopen</function> Example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$fp = gzopen("/tmp/file.gz", "r");
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>gzclose</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|