<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.6 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
  <refentry id="function.xdiff-file-patch-binary">
   <refnamediv>
    <refname>xdiff_file_patch_binary</refname>
    <refpurpose>
     Patch a file with a binary diff
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <methodsynopsis>
     <type>bool</type><methodname>xdiff_file_patch_binary</methodname>
     <methodparam><type>string</type><parameter>file</parameter></methodparam>
     <methodparam><type>string</type><parameter>patch</parameter></methodparam>
     <methodparam><type>string</type><parameter>dest</parameter></methodparam>
    </methodsynopsis>
    <para>
     <function>xdiff_file_patch_binary</function> patches file
     <parameter>file</parameter> with binary patch in file 
     <parameter>patch</parameter> and stores result in file
     <parameter>dest</parameter>.
    </para>
    <note>
     <para>
      Both files (file and patch) will be loaded into memory so ensure that your memory_limit is set high enough.
     </para>
    </note>
    <para>
     &return.success;
    </para>
    <example>
     <title><function>xdiff_file_patch_binary</function> example</title>
     <para>
      The following code applies binary diff to a file.
     </para>
     <programlisting role="php">
<![CDATA[
<?php
$old_version = 'archive-1.0.tgz';
$patch = 'archive.bpatch';

$result = xdiff_file_patch_binary($old_version, $patch, 'archive-1.1.tgz');
if ($result) {
   echo "File patched";
} else {
   echo "File couldn't be patched";
}

?>
]]>
     </programlisting>
    </example>
    <para>
     See also <function>xdiff_string_patch_binary</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
-->