<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.bzopen" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>bzopen</refname>
  <refpurpose>Opens a bzip2 compressed file</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type class="union"><type>resource</type><type>false</type></type><methodname>bzopen</methodname>
   <methodparam><type class="union"><type>string</type><type>resource</type></type><parameter>file</parameter></methodparam>
   <methodparam><type>string</type><parameter>mode</parameter></methodparam>
  </methodsynopsis>
  <para>
   <function>bzopen</function> opens a bzip2 (<filename>.bz2</filename>) file for reading or
   writing.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>file</parameter></term>
     <listitem>
      <para>
       The name of the file to open, or an existing stream resource.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>mode</parameter></term>
     <listitem>
      <para>
       The modes <literal>'r'</literal> (read), and <literal>'w'</literal> (write) are supported.
       Everything else will cause <function>bzopen</function> to return &false;.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   If the open fails, <function>bzopen</function> returns &false;, otherwise
   it returns a pointer to the newly opened file.
  </para>
 </refsect1>
 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>bzopen</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php

$file = "/tmp/foo.bz2";
$bz = bzopen($file, "r") or die("Couldn't open $file for reading");

bzclose($bz);

?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>
 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>bzclose</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
-->
