mkdir
[scilab.git] / scilab / modules / fileio / help / en_US / mkdir.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 - Allan CORNET
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:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="mkdir" xml:lang="en">
15     <refnamediv>
16         <refname>mkdir</refname>
17         <refpurpose>makes a new directory</refpurpose>
18     </refnamediv>
19     <refsynopsisdiv>
20         <title>Calling Sequence</title>
21         <synopsis>
22             mkdir(dirname)
23             mkdir(parentdir, dirname)
24             status = mkdir( ... )
25             [status, msg] = mkdir( ... )
26         </synopsis>
27     </refsynopsisdiv>
28     <refsection>
29         <title>Arguments</title>
30         <variablelist>
31             <varlistentry>
32                 <term>dirname</term>
33                 <listitem>
34                     <para>
35                         a character string: a directory to create.
36                     </para>
37                 </listitem>
38             </varlistentry>
39             <varlistentry>
40                 <term>parentdir</term>
41                 <listitem>
42                     <para>
43                         a character string: a directory in which the new directory <varname>dirname</varname> will be created.
44                     </para>
45                 </listitem>
46             </varlistentry>
47             <varlistentry>
48                 <term>status</term>
49                 <listitem>
50                     <para>
51                         an integer: the status of the operation.
52                     </para>
53                 </listitem>
54             </varlistentry>
55             <varlistentry>
56                 <term>msg</term>
57                 <listitem>
58                     <para>
59                         a character string: a message about an error.
60                     </para>
61                 </listitem>
62             </varlistentry>
63         </variablelist>
64     </refsection>
65     <refsection>
66         <title>Description</title>
67         <para>
68             <code>mkdir(dirname)</code> creates the directory <varname>dirname</varname> in the current directory, if <varname>dirname</varname> represents a relative path. Otherwise, <varname>dirname</varname> represents an absolute path and <function>mkdir</function> attempts to create the absolute directory <varname>dirname</varname>.
69         </para>
70         <para>
71             <code>mkdir(parentdir, dirname)</code> creates the directory <varname>dirname</varname> in the directory <varname>parentdir</varname> (if <varname>parentdir</varname> is not existing it will be created), where <varname>parentdir</varname> is an absolute or relative pathname.
72         </para>
73         <para>
74             <code>[status,msg] = mkdir(parentdir, dirname)</code> creates the directory <varname>dirname</varname> in the existing directory <varname>parentdir</varname>, returning the status and the message about an error. 
75         </para>
76         <para>   
77             <informaltable frame='all'>
78                 <tr>
79                     <td>
80                         <varname>status</varname>
81                     </td>
82                     <td>
83                         <varname>msg</varname>
84                     </td>
85                 </tr>
86                 <tr>
87                     <td>
88                         -2
89                     </td>
90                     <td>
91                         mkdir: An error occurred: A file with the same name already exists in dirname
92                         
93                     </td>
94                 </tr>
95                 <tr>
96                     <td>
97                         0
98                     </td>
99                     <td>
100                         mkdir: An error occurred: Impossible to create directory dirname
101                         
102                     </td>
103                 </tr>
104                 <tr>
105                     <td>
106                         1
107                     </td>
108                     
109                     <td>
110                         Success
111                     </td>
112                 </tr>
113                 <tr>
114                     <td>
115                         2
116                     </td>
117                     <td>
118                         mkdir: An error occurred: This directory already exists in dirname
119                         
120                     </td>
121                 </tr>
122             </informaltable>
123                 
124         </para>
125     </refsection>
126     <refsection>
127         <title>Examples</title>
128         <programlisting role="example">
129             <![CDATA[ 
130 // Absolute pathname
131 mkdir(TMPDIR+"/mkdir_example_1")
132 status_2 = mkdir(TMPDIR+"/mkdir_example_2")
133 [status_3,msg_3] = mkdir(TMPDIR+"/mkdir_example_3")
134
135 // Absolute pathname (parentdir + dirname)
136 [status_4,msg_4] = mkdir(TMPDIR,"mkdir_example_4")
137
138 // Relative pathname
139 cd TMPDIR;
140 [status_5,msg_5] = mkdir("mkdir_example_5")
141 [status_6,msg_6] = mkdir("mkdir_example_5/mkdir_example_6")
142  ]]>
143         </programlisting>
144     </refsection>
145     <refsection role="see also">
146         <title>See Also</title>
147         <simplelist type="inline">
148             <member>
149                 <link linkend="cd">cd</link>
150             </member>
151             <member>
152                 <link linkend="dir">dir</link>
153             </member>
154             <member>
155                 <link linkend="rmdir">rmdir</link>
156             </member>
157         </simplelist>
158     </refsection>
159 </refentry>