1
<?xml version="1.0" encoding="UTF-8"?>
3
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4
* Copyright (C) XXXX-2008 - INRIA
6
* This file must be used under the terms of the CeCILL.
7
* This source file is licensed as described in the file COPYING, which
8
* you should have received as part of this distribution. The terms
9
* are also available at
10
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13
<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="getrelativefilename">
15
<refname>getrelativefilename</refname>
16
<refpurpose>given an absolute directory and an absolute filename, returns a relative file name</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>rel_file = getrelativefilename(abs_dir,abs_file)</synopsis>
23
<title>Arguments</title>
28
<para>a character string: an absolute directory.</para>
34
<para>a character string: an absolute filename.</para>
40
<para>a character string : relative filename.</para>
46
<title>Description</title>
48
Given an absolute directory <varname>abs_dir</varname> and an absolute filename <varname>abs_file</varname>, <function>getrelativefilename</function> returns a
49
relative file name <varname>rel_file</varname>.
52
For example, if the current directory is
53
<literal>C:\scilab\bin</literal> and the filename
54
<literal>C:\scilab\modules\helptools\readme.txt</literal> is
55
given, <function>getrelativefilename</function> will return
56
<literal>..\modules\helptools\readme.txt</literal>.
60
<title>Examples</title>
61
<programlisting role="example"><![CDATA[
62
getrelativefilename(pwd(), SCI+'/COPYING')
63
getrelativefilename(TMPDIR, SCI+'/COPYING')
64
getrelativefilename(SCI+'/bin', SCI+'/COPYING')
65
getrelativefilename(pwd(), SCI+'/ACKNOLEDGMENTS')
66
getrelativefilename(TMPDIR, SCI+'/ACKNOLEDGMENTS')
67
getrelativefilename(SCI+'/bin', SCI+'/ACKNOLEDGMENTS')
70
<refsection role="see also">
71
<title>See Also</title>
72
<simplelist type="inline">
74
<link linkend="getshortpathname">getshortpathname</link>
77
<link linkend="getlongpathname">getlongpathname</link>
80
<link linkend="pwd">pwd</link>