php-doc-en/reference/zlib/functions/gzopen.xml
2003-12-15 16:55:22 +00:00

81 lines
2.6 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/zlib.xml, last change in rev 1.2 -->
<refentry id="function.gzopen">
<refnamediv>
<refname>gzopen</refname>
<refpurpose>Open gz-file</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<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></methodparam>
</methodsynopsis>
<para>
Opens a gzip (.gz) file for reading or writing. The mode
parameter is as in <function>fopen</function> ("rb" or "wb") but
can also include a compression level ("wb9") or a strategy: 'f'
for filtered data as in "wb6f", 'h' for Huffman only compression
as in "wb1h". (See the description of deflateInit2 in zlib.h for
more information about the strategy parameter.)
</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>
<para>
<function>gzopen</function> 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>
<para>
You can use the optional third parameter and set it to "1", if
you want to search for the file in the <link
linkend="ini.include-path">include_path</link>, too.
</para>
<para>
<example>
<title><function>gzopen</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
$fp = gzopen("/tmp/file.gz", "r");
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>gzclose</function>.
</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:"../../../../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
-->