<?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> <refentry id="function.copy"> <refnamediv> <refname>copy</refname> <refpurpose>Copies file</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>int</type><methodname>copy</methodname> <methodparam><type>string</type><parameter>source</parameter></methodparam> <methodparam><type>string</type><parameter>dest</parameter></methodparam> </methodsynopsis> <para> Makes a copy of a file. Returns &true; if the copy succeeded, &false; otherwise. <example> <title><function>copy</function> example</title> <programlisting role="php"> <![CDATA[ if (!copy($file, $file.'.bak')) { print ("failed to copy $file...<br>\n"); } ]]> </programlisting> </example> </para> <note> <para> As of PHP 4.3.0, both <parameter>source</parameter> and <parameter>dest</parameter> may be URLs if the "fopen wrappers" have been enabled. See <function>fopen</function> for more details. If <parameter>dest</parameter> is an URL, the copy operation may fail if the wrapper does not support overwriting of existing files. </para> </note> <warning> <para> If the destination file already exists, it will be overwritten. </para> </warning> <para> See also <function>move_uploaded_file</function>, <function>rename</function>, and the section of the manual about <link linkend="features.file-upload">handling file uploads</link>. </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 -->