Revision of English help pages for different functions (nothing serious).
[scilab.git] / scilab / modules / fileio / help / en_US / path_filename / basename.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - INRIA
5  * ...
6  *
7  * This file must be used under the terms of the CeCILL.
8  * This source file is licensed as described in the file COPYING, which
9  * you should have received as part of this distribution.  The terms
10  * are also available at
11  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12  *
13  -->
14 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="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="basename" xml:lang="en">
15     <refnamediv>
16         <refname>basename</refname>
17         <refpurpose>strip directory and suffix from filenames</refpurpose>
18     </refnamediv>
19     <refsynopsisdiv>
20         <title>Calling Sequence</title>
21         <synopsis>processedfiles = basename(files[,flag [,flagexpand]])</synopsis>
22     </refsynopsisdiv>
23     <refsection>
24         <title>Arguments</title>
25         <variablelist>
26             <varlistentry>
27                 <term>files</term>
28                 <listitem>
29                     <para>a string matrix giving a set of file names.</para>
30                 </listitem>
31             </varlistentry>
32             <varlistentry>
33                 <term>flag</term>
34                 <listitem>
35                     <para>optional boolean, used to convert the given path(s) for the current operating system.
36                         Default value is true (<constant>%t</constant>).
37                     </para>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>flagexpand</term>
42                 <listitem>
43                     <para>optional boolean, used to expand leading 
44                         variables in paths. Only used with 
45                         <varname>flag</varname> argument. Default value 
46                         is true (<constant>%t</constant>).
47                     </para>
48                 </listitem>
49             </varlistentry>
50             <varlistentry>
51                 <term>processedFiles</term>
52                 <listitem>
53                     <para>a string matrix containing the processed filenames.</para>
54                 </listitem>
55             </varlistentry>
56         </variablelist>
57     </refsection>
58     <refsection>
59         <title>Description</title>
60         <para>
61             <code>basename(files)</code> returns the suffixs of paths, i.e. the last string following the final file separator for each path given in <varname>files</varname>.
62         </para>
63         <para>
64             If <varname>flag</varname> is true the paths are first converted for the current operating system (for example, 'C:/Tmp/folder' will be converted on Windows to 'C:\Tmp\folder').
65         </para>
66         <para>
67             if <varname>flagexpand</varname> is true, leading path variables (HOME, SCI, SCIHOME, ...) are expanded for the current operating system
68             (for example, 'HOME\tmp' will be converted on Linux to 'home/&lt;user&gt;/tmp', where &lt;user&gt; is the current user logged on).
69         </para>
70         <para>
71             See more details on <varname>flag</varname> and <varname>flagexpand</varname> in <link linkend="pathconvert">pathconvert</link> section.
72         </para>
73     </refsection>
74     <refsection>
75         <title>Examples</title>
76         <programlisting role="example"><![CDATA[
77 files=basename('/tmp/poo')
78 files=basename('/tmp/poo.sci')
79 files=basename('/tmp/poo.bak.sci')
80 files=basename('/tmp/')
81
82 files=basename('C:\tmp\poo')
83 files=basename('C:\tmp\poo.sci')
84 files=basename('C:\tmp\poo.bak.sci')
85
86 files=basename('C:\tmp\')
87
88 files=basename(['SCI/etc/scilab.start', 'SCI/etc/scilab.quit'])
89  ]]></programlisting>
90     </refsection>
91     <refsection role="see also">
92         <title>See Also</title>
93         <simplelist type="inline">
94             <member>
95                 <link linkend="listfiles">listfiles</link>
96             </member>
97             <member>
98                 <link linkend="pathconvert">pathconvert</link>
99             </member>
100             <member>
101                 <link linkend="fileparts">fileparts</link>
102             </member>
103         </simplelist>
104     </refsection>
105 </refentry>