<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2009 - DIGITEO - Allan CORNET
 * 
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at    
 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="movefile" xml:lang="en">
    <refnamediv>
        <refname>movefile</refname>
        <refpurpose>moves file or directory</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Calling Sequence</title>
        <synopsis>movefile(source, destination)
            [status, message] = movefile(source, destination)
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>source</term>
                <listitem>
                    <para>
                        a character string.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>destination</term>
                <listitem>
                    <para>
                        a character string.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>status</term>
                <listitem>
                    <para>
                        an integer: the status of the operation.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>message</term>
                <listitem>
                    <para>
                        a character string: a message about an error.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    
    <refsection>
        <title>Description</title>
        <para>
            <code>movefile(source, destination)</code> moves the file or directory 
            <varname>source</varname> (and subdirectories) to the file or directory 
            <varname>destination</varname>.
        </para>
        <para>
            If <varname>source</varname> is a directory, <varname>destination</varname> cannot be a file.
            <warning>
                <function>movefile</function> replaces existing files without 
                warning.
            </warning>
        </para>
        <para>
            <code>[status, message] = movefile(source, destination)</code> moves <varname>source</varname> to <varname>destination</varname>, returning the <varname>status</varname> and a <varname>message</varname>. 
        </para>
        <para>
            Whatever the operating system, if the move succeeds, the 
            <varname>status</varname> is 1 and the <varname>message</varname> is 
            empty; if the move fails, the <varname>status</varname> is 0 and the 
            <varname>message</varname> is not empty.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
      copyfile(SCI+"/etc/scilab.start",TMPDIR+"/scilab.start")
      [status,message] = movefile(TMPDIR+"/scilab.start",TMPDIR+"/renamed_scilab.start")
    ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See Also</title>
        <simplelist type="inline">
            <member>
                <link linkend="copyfile">copyfile</link>
            </member>
        </simplelist>
    </refsection>
</refentry>