88c5e0f80453a4b557ee52c7bd7e6961c64a86b4
[scilab.git] / scilab / modules / fileio / help / en_US / directory / chdir.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  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  * Copyright (C) 2019 - Samuel GOUGEON
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15  *
16  -->
17 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18           xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19           xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20           xml:lang="en" xml:id="chdir">
21     <refnamediv>
22         <refname>chdir</refname>
23         <refpurpose>changes Scilab current directory</refpurpose>
24     </refnamediv>
25     <refnamediv xml:id="cd">
26         <refname>cd</refname>
27         <refpurpose>changes Scilab current directory</refpurpose>
28     </refnamediv>
29     <refsynopsisdiv>
30         <title>Syntax</title>
31         <synopsis>
32             b = chdir(path)
33             realpath = cd(path)
34             cd path
35         </synopsis>
36     </refsynopsisdiv>
37     <refsection>
38         <title>Arguments</title>
39         <variablelist>
40             <varlistentry>
41                 <term>path</term>
42                 <listitem>
43                   <para>a character string</para>. The default path is <literal>home</literal>.
44                 </listitem>
45             </varlistentry>
46             <varlistentry>
47                 <term>b</term>
48                 <listitem>
49                     <para>
50                         a boolean:  <constant>%t</constant> if <function>chdir</function> operation
51                         is successful.
52                     </para>
53                 </listitem>
54             </varlistentry>
55             <varlistentry>
56                 <term>realpath</term>
57                 <listitem>
58                     <para>a character string, the real path name after pathname
59                         conversion (see below)
60                     </para>
61                 </listitem>
62             </varlistentry>
63         </variablelist>
64     </refsection>
65     <refsection>
66         <title>Description</title>
67         <para>Change the current Scilab directory to those given by
68             <varname>path</varname>.
69         </para>
70         <para>
71             <note>
72                 Note that, if any, <link linkend="SCI">SCI</link>,
73                 <link linkend="SCIHOME">SCIHOME</link>,
74                 <link linkend="TMPDIR">TMPDIR</link> and
75                 <link linkend="home">home</link> headings constants in path are  converted.
76                 For example,  <literal>SCI/modules/core/macros</literal> is a valid pattern for
77                 both Unix and Windows.
78             </note>
79         </para>
80     </refsection>
81     <refsection>
82         <title>Examples</title>
83         <programlisting role="example"><![CDATA[
84 chdir("SCI/etc")
85 pwd
86 cd ..
87 cd TMPDIR
88 p = cd()
89 p == home
90      ]]></programlisting>
91         <screen><![CDATA[
92 --> chdir("SCI/etc")
93  ans  =
94   T
95
96 --> pwd
97  ans  =
98  C:\Programs\scilab\scilab-6.0.2\etc
99
100
101 --> cd ..
102  ans  =
103  C:\Programs\scilab\scilab-6.0.2
104
105 --> cd TMPDIR
106  ans  =
107  C:\Users\Me\AppData\Local\Temp\SCI_TMP_5444_26901
108
109 --> p = cd()
110  p  =
111  C:\Users\Me
112
113 --> p == home
114  ans  =
115   T
116 ]]></screen>
117     </refsection>
118     <refsection role="see also">
119         <title>See also</title>
120         <simplelist type="inline">
121             <member>
122                 <link linkend="isdir">isdir</link>
123             </member>
124             <member>
125                 <link linkend="pwd">pwd</link>
126             </member>
127             <member>
128                 <link linkend="home">home</link>
129             </member>
130             <member>
131                 <link linkend="filebrowser">filebrowser</link>
132             </member>
133             <member>
134                 <link linkend="uigetdir">uigetdir</link>
135             </member>
136         </simplelist>
137     </refsection>
138 </refentry>