autodoc.git
/
traditional_manual
/
chapter_9.html
version
»
Context lines:
10
20
40
80
file
none
3
autodoc.git/traditional_manual/chapter_9.html:203:
<dd class='body--doc'><p>Returns 1 if ok, 0 if failed.</p> </dd></dl> </dd> <dt><a name='9.2'></a> <h2 class='header'>9.2. Path manipulation</h2></dt> <dd> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>basename</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>basename</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns the last segment of a path.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>dirname()</code>, <code>explode_path()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>dirname</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>dirname</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns all but the last segment of a path. Some example inputs and
+
outputs:</p>
+
<p> <table class='box'>
+
<tr><td><b>Expression</b></td><td><b>Value</b></td></tr>
+
<tr><td>dirname("/a/b")</td><td>"/a"</td></tr>
+
<tr><td>dirname("/a/")</td><td>"/a"</td></tr>
+
<tr><td>dirname("/a")</td><td>"/"</td></tr>
+
<tr><td>dirname("/")</td><td>"/"</td></tr>
+
<tr><td>dirname("")</td><td>""</td></tr>
+
</table>
+
</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>basename()</code>, <code>explode_path()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>combine_path</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>combine_path_unix</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>combine_path_nt</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>combine_path_amigaos</b></span><br>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>combine_path</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code>, <code class='datatype'>string</code> ... <code class='argument'>paths</code><b>)</b></code><br>
+
<code><code class='datatype'>string</code> <b><span class='method'>combine_path_unix</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code>, <code class='datatype'>string</code> ... <code class='argument'>paths</code><b>)</b></code><br>
+
<code><code class='datatype'>string</code> <b><span class='method'>combine_path_nt</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code>, <code class='datatype'>string</code> ... <code class='argument'>paths</code><b>)</b></code><br>
+
<code><code class='datatype'>string</code> <b><span class='method'>combine_path_amigaos</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code>, <code class='datatype'>string</code> ... <code class='argument'>paths</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Concatenate a number of paths to a straightforward path without
+
any <code class='expr'>"//"</code>, <code class='expr'>"/.."</code> or <code class='expr'>"/."</code>. If any path
+
argument is absolute then the result is absolute and the
+
preceding arguments are ignored. If the result is relative then
+
it might have leading <code class='expr'>".."</code> components. If the last
+
nonempty argument ends with a directory separator then the
+
result ends with that too. If all components in a relative path
+
disappear due to subsequent <code class='expr'>".."</code> components then the
+
result is <code class='expr'>"."</code>.</p>
+
<p> <code>combine_path_unix()</code> concatenates in UNIX style, which also is
+
appropriate for e.g. URL:s ("/" separates path components and
+
absolute paths start with "/"). <code>combine_path_nt()</code>
+
concatenates according to NT filesystem conventions ("/" and "\"
+
separates path components and there might be a drive letter in
+
front of absolute paths). <code>combine_path_amigaos()</code> concatenates
+
according to AmigaOS filesystem conventions.</p>
+
<p> <code>combine_path()</code> is equivalent to <code>combine_path_unix()</code> on UNIX-like
+
operating systems, and equivalent to <code>combine_path_nt()</code> on NT-like
+
operating systems, and equivalent to <code>combine_path_amigaos()</code> on
+
AmigaOS-like operating systems.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>getcwd()</code>, <code>Stdio.append_path()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>explode_path</b></span> </dt> <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>string</code>) <b><span class='method'>explode_path</span>(</b><code class='datatype'>string</code> <code class='argument'>p</code><b>)</b></code></p></dd> <dt class='head--doc'>Description</dt> <dd class='body--doc'><p>Split a path <code>p</code> into its components.</p> <p> This function divides a path into its components. This might seem like it could be done by dividing the string on <tt>"/"</tt>, but that will not work on some operating systems. To turn the components back into a path again, use <code>combine_path()</code>.</p>