<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA - Allan CORNET
 * ...
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<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="deletefile" xml:lang="en">
    <refnamediv>
        <refname>deletefile</refname>
        <refpurpose>deletes a file</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>status = deletefile(filename)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>filename</term>
                <listitem>
                    <para>character strings interpreted as existing file names or not.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>status</term>
                <listitem>
                    <para>
                        booleans <constant>%t</constant> on success or <constant>%f</constant> on error. It has the same size as <varname>filename</varname>.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            This function deletes a file <varname>filename</varname>.
            If file <varname>filename</varname> has been deleted,
            it will return <constant>%t</constant> else <constant>%f</constant>.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
fd = mopen(TMPDIR+'/filetodelete.txt','wt');
mclose(fd);

if (fileinfo(TMPDIR+'/filetodelete.txt') <> []) then
deletefile(TMPDIR+'/filetodelete.txt')
end

deletefile(TMPDIR+'/notexistingfile')

deletefile(TMPDIR+['/notexistingfile' '/notexistingsecondfile'])
    ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See Also</title>
        <simplelist type="inline">
            <member>
                <link linkend="mdelete">mdelete</link>
            </member>
            <member>
                <link linkend="rmdir">rmdir</link>
            </member>
        </simplelist>
    </refsection>
    <refsection>
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>6.0.0</revnumber>
                <revremark>Manage multi-dimensionnal arguments to remove multiple files at once.</revremark>
            </revision>
        </revhistory>
    </refsection>
</refentry>
