3
<link rel="stylesheet" href="style.css" type="text/css">
4
<link rel="Start" href="index.html">
5
<link rel="previous" href="Event.html">
6
<link rel="next" href="Format.html">
7
<link rel="Up" href="index.html">
8
<link title="Index of types" rel="Appendix" href="index_types.html">
9
<link title="Index of exceptions" rel="Appendix" href="index_exceptions.html">
10
<link title="Index of values" rel="Appendix" href="index_values.html">
11
<link title="Index of class attributes" rel="Appendix" href="index_attributes.html">
12
<link title="Index of class methods" rel="Appendix" href="index_methods.html">
13
<link title="Index of classes" rel="Appendix" href="index_classes.html">
14
<link title="Index of class types" rel="Appendix" href="index_class_types.html">
15
<link title="Index of modules" rel="Appendix" href="index_modules.html">
16
<link title="Index of module types" rel="Appendix" href="index_module_types.html">
17
<link title="Arg" rel="Chapter" href="Arg.html">
19
<link title="Arith_status" rel="Chapter" href="Arith_status.html">
21
<link title="Array" rel="Chapter" href="Array.html">
23
<link title="ArrayLabels" rel="Chapter" href="ArrayLabels.html">
25
<link title="Big_int" rel="Chapter" href="Big_int.html">
27
<link title="Bigarray" rel="Chapter" href="Bigarray.html">
29
<link title="Buffer" rel="Chapter" href="Buffer.html">
31
<link title="Callback" rel="Chapter" href="Callback.html">
33
<link title="Char" rel="Chapter" href="Char.html">
35
<link title="Condition" rel="Chapter" href="Condition.html">
37
<link title="Dbm" rel="Chapter" href="Dbm.html">
39
<link title="Digest" rel="Chapter" href="Digest.html">
41
<link title="Dynlink" rel="Chapter" href="Dynlink.html">
43
<link title="Event" rel="Chapter" href="Event.html">
45
<link title="Filename" rel="Chapter" href="Filename.html">
47
<link title="Format" rel="Chapter" href="Format.html">
49
<link title="Gc" rel="Chapter" href="Gc.html">
51
<link title="Genlex" rel="Chapter" href="Genlex.html">
53
<link title="Graphics" rel="Chapter" href="Graphics.html">
55
<link title="GraphicsX11" rel="Chapter" href="GraphicsX11.html">
57
<link title="Hashtbl" rel="Chapter" href="Hashtbl.html">
59
<link title="Int32" rel="Chapter" href="Int32.html">
61
<link title="Int64" rel="Chapter" href="Int64.html">
63
<link title="Lazy" rel="Chapter" href="Lazy.html">
65
<link title="Lexing" rel="Chapter" href="Lexing.html">
67
<link title="List" rel="Chapter" href="List.html">
69
<link title="ListLabels" rel="Chapter" href="ListLabels.html">
71
<link title="Map" rel="Chapter" href="Map.html">
73
<link title="Marshal" rel="Chapter" href="Marshal.html">
75
<link title="MoreLabels" rel="Chapter" href="MoreLabels.html">
77
<link title="Mutex" rel="Chapter" href="Mutex.html">
79
<link title="Nativeint" rel="Chapter" href="Nativeint.html">
81
<link title="Num" rel="Chapter" href="Num.html">
83
<link title="Obj" rel="Chapter" href="Obj.html">
85
<link title="Oo" rel="Chapter" href="Oo.html">
87
<link title="Parsing" rel="Chapter" href="Parsing.html">
89
<link title="Pervasives" rel="Chapter" href="Pervasives.html">
91
<link title="Printexc" rel="Chapter" href="Printexc.html">
93
<link title="Printf" rel="Chapter" href="Printf.html">
95
<link title="Queue" rel="Chapter" href="Queue.html">
97
<link title="Random" rel="Chapter" href="Random.html">
99
<link title="Set" rel="Chapter" href="Set.html">
101
<link title="Sort" rel="Chapter" href="Sort.html">
103
<link title="Stack" rel="Chapter" href="Stack.html">
105
<link title="StdLabels" rel="Chapter" href="StdLabels.html">
107
<link title="Str" rel="Chapter" href="Str.html">
109
<link title="Stream" rel="Chapter" href="Stream.html">
111
<link title="String" rel="Chapter" href="String.html">
113
<link title="StringLabels" rel="Chapter" href="StringLabels.html">
115
<link title="Sys" rel="Chapter" href="Sys.html">
117
<link title="Thread" rel="Chapter" href="Thread.html">
119
<link title="ThreadUnix" rel="Chapter" href="ThreadUnix.html">
121
<link title="Tk" rel="Chapter" href="Tk.html">
123
<link title="Unix" rel="Chapter" href="Unix.html">
125
<link title="UnixLabels" rel="Chapter" href="UnixLabels.html">
127
<link title="Weak" rel="Chapter" href="Weak.html">
128
<title>Filename</title>
131
<div class="navbar"><a href="Event.html">Previous</a>
132
<a href="index.html">Up</a>
133
<a href="Format.html">Next</a>
135
<center><h1>Module <a href="type_Filename.html">Filename</a></h1></center>
137
<pre><span class="keyword">module</span> Filename = <code><span class="keyword">struct</span> ... <span class="keyword">end</span> </code></pre><div class="info">
138
Operations on file names.<br>
141
<pre><span class="keyword">val</span> <a name="VALcurrent_dir_name"></a>current_dir_name : <code class="type">string</code></pre><div class="info">
142
The conventional name for the current directory (e.g. <code>.</code> in Unix).<br>
144
<pre><span class="keyword">val</span> <a name="VALparent_dir_name"></a>parent_dir_name : <code class="type">string</code></pre><div class="info">
145
The conventional name for the parent of the current directory
146
(e.g. <code>..</code> in Unix).<br>
148
<pre><span class="keyword">val</span> <a name="VALconcat"></a>concat : <code class="type">string -> string -> string</code></pre><div class="info">
149
<code>concat dir file</code> returns a file name that designates file
150
<code>file</code> in directory <code>dir</code>.<br>
152
<pre><span class="keyword">val</span> <a name="VALis_relative"></a>is_relative : <code class="type">string -> bool</code></pre><div class="info">
153
Return <code><span class="keyword">true</span></code> if the file name is relative to the current
154
directory, <code><span class="keyword">false</span></code> if it is absolute (i.e. in Unix, starts
155
with <code>/</code>).<br>
157
<pre><span class="keyword">val</span> <a name="VALis_implicit"></a>is_implicit : <code class="type">string -> bool</code></pre><div class="info">
158
Return <code><span class="keyword">true</span></code> if the file name is relative and does not start
159
with an explicit reference to the current directory (<code>./</code> or
160
<code>../</code> in Unix), <code><span class="keyword">false</span></code> if it starts with an explicit reference
161
to the root directory or the current directory.<br>
163
<pre><span class="keyword">val</span> <a name="VALcheck_suffix"></a>check_suffix : <code class="type">string -> string -> bool</code></pre><div class="info">
164
<code>check_suffix name suff</code> returns <code><span class="keyword">true</span></code> if the filename <code>name</code>
165
ends with the suffix <code>suff</code>.<br>
167
<pre><span class="keyword">val</span> <a name="VALchop_suffix"></a>chop_suffix : <code class="type">string -> string -> string</code></pre><div class="info">
168
<code>chop_suffix name suff</code> removes the suffix <code>suff</code> from
169
the filename <code>name</code>. The behavior is undefined if <code>name</code> does not
170
end with the suffix <code>suff</code>.<br>
172
<pre><span class="keyword">val</span> <a name="VALchop_extension"></a>chop_extension : <code class="type">string -> string</code></pre><div class="info">
173
Return the given file name without its extension. The extension
174
is the shortest suffix starting with a period, <code>.xyz</code> for instance.<br>
175
Raise <code><span class="constructor">Invalid_argument</span></code> if the given name does not contain
178
<pre><span class="keyword">val</span> <a name="VALbasename"></a>basename : <code class="type">string -> string</code></pre><div class="info">
179
Split a file name into directory name / base file name.
180
<a href="Filename.html#VALconcat"><code><span class="constructor">Filename</span>.concat</code></a> <code>(</code><a href="Filename.html#VALdirname"><code><span class="constructor">Filename</span>.dirname</code></a><code> name) (</code><a href="Filename.html#VALbasename"><code><span class="constructor">Filename</span>.basename</code></a><code> name)</code>
181
returns a file name which is equivalent to <code>name</code>. Moreover, after setting the
182
current directory to <a href="Filename.html#VALdirname"><code><span class="constructor">Filename</span>.dirname</code></a><code> name</code> (with <a href="Sys.html#VALchdir"><code><span class="constructor">Sys</span>.chdir</code></a>),
183
references to <a href="Filename.html#VALbasename"><code><span class="constructor">Filename</span>.basename</code></a><code> name</code> (which is a relative file name)
184
designate the same file as <code>name</code> before the call to <a href="Sys.html#VALchdir"><code><span class="constructor">Sys</span>.chdir</code></a>.<br>
186
<pre><span class="keyword">val</span> <a name="VALdirname"></a>dirname : <code class="type">string -> string</code></pre><div class="info">
187
See <a href="Filename.html#VALdirname"><code><span class="constructor">Filename</span>.dirname</code></a>.<br>
189
<pre><span class="keyword">val</span> <a name="VALtemp_file"></a>temp_file : <code class="type">string -> string -> string</code></pre><div class="info">
190
<code>temp_file prefix suffix</code> returns the name of a
191
fresh temporary file in the temporary directory.
192
The base name of the temporary file is formed by concatenating
193
<code>prefix</code>, then a suitably chosen integer number, then <code>suffix</code>.
194
The temporary file is created empty, and is guaranteed to be
195
different from any other file that existed when <code>temp_file</code>
197
Under Unix, the temporary directory is <code>/tmp</code> by default; if set,
198
the value of the environment variable <code><span class="constructor">TMPDIR</span></code> is used instead.
199
Under Windows, the name of the temporary directory is the
200
value of the environment variable <code><span class="constructor">TEMP</span></code>,
201
or <code>C:\temp</code> by default.
202
Under MacOS, the name of the temporary directory is given
203
by the environment variable <code><span class="constructor">TempFolder</span></code>; if not set,
204
temporary files are created in the current directory.<br>
206
<pre><span class="keyword">val</span> <a name="VALquote"></a>quote : <code class="type">string -> string</code></pre><div class="info">
207
Return a quoted version of a file name, suitable for use as
208
one argument in a shell command line, escaping any shell
b'\\ No newline at end of file'