<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 * ...
 *
 * 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:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="ls">
    <refnamediv>
        <refname>ls</refname>
        <refpurpose>shows files</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            files = ls [path]
            files = ls( [path] )
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>path</term>
                <listitem>
                    <para>
                        a string matrix giving a directory pathname (eventually  ended
                        by a pattern built with <literal>*</literal>). Default value is <literal>.</literal> (a dot).
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>files</term>
                <listitem>
                    <para>
                        a string column vector. By default it contains a column
                        formatted output.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <function>ls</function> can be used to list the files which match
            the patterns given by the <varname>path</varname> argument.
            Patterns are given to the Unix <command>ls</command> or to the Windows
            <command>dir</command> commands in order to get information on files.
            Thus in order to write portable Scilab script valid wildcard patterns
            for both OS are to be given. Note that pathname conversion is
            performed and for example <literal>SCI/modules/core/macros/*.sci</literal> is a valid
            pattern for both Unix and Windows.
        </para>
        <para>
            If you want to get a vector of all files matching a pattern use preferably
            the  <link linkend="listfiles">listfiles</link>  or the <link linkend="dir">dir</link> function.
        </para>
        <para>
            <note>
                Please note that starting from the version 5.0 of Scilab, the second
                input argument has been removed (a sequence of strings which can
                be added under Unix systems: the Unix <command>ls</command> command
                options). This option has been removed mainly for security and portability reasons.
            </note>
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
ls
ls SCI/modules/core/macros/*.sci
x=ls('SCI/modules/core/macros/*.sci')
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="listfiles">listfiles</link>
            </member>
            <member>
                <link linkend="findfiles">findfiles</link>
            </member>
            <member>
                <link linkend="dir">dir</link>
            </member>
            <member>
                <link linkend="fileinfo">fileinfo</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
