1
<?xml version="1.0" encoding="UTF-8"?>
3
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4
* Copyright (C) 2008 - INRIA
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
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:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="dirname">
16
<refname>dirname</refname>
17
<refpurpose>gets directory from filenames</refpurpose>
20
<title>Calling Sequence</title>
21
<synopsis>dirs = dirname(files[, flag [,flagexpand]])</synopsis>
24
<title>Arguments</title>
29
<para>a string matrix giving a set of file names</para>
33
<term>flag, flagexpand</term>
36
boolean optional parameters (default value <constant>%t</constant>)
41
<term>files, dirs</term>
43
<para>string matrices</para>
49
<title>Description</title>
51
<function>dirname</function> returns the directory names of the file entries given in <varname>files</varname>.
54
If <varname>flag</varname> is true the files are first converted to the target
55
type given by the <code>getos() == 'Windows'</code> variable.
56
Moreover, if <varname>flagexpand</varname> is true leading strings like
57
<literal>SCIHOME</literal>, <literal>SCI</literal> or <literal>~</literal> are expanded using environment
61
Note that <code>dirname(files,%f)</code> can give erroneous results if
62
pathnames given in <varname>files</varname> do not follow the convention
63
given by the <code>getos() == 'Windows'</code> variable.
67
<title>Examples</title>
68
<programlisting role="example"><![CDATA[
69
dirs=dirname('SCI/modules/fileio/macros/poo.sci')
70
dirs=dirname('SCI/modules\fileio/macros/poo.sci')
71
dirs=dirname('SCI/modules\fileio/macros/poo.sci.k')
74
<refsection role="see also">
75
<title>See Also</title>
76
<simplelist type="inline">
78
<link linkend="basename">basename</link>
81
<link linkend="listfiles">listfiles</link>
84
<link linkend="pathconvert">pathconvert</link>