UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

160 lines (156 loc) 32.8 kB
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="theme-color" content="#273f79"/><link rel="stylesheet" href="lpdoc.css" type="text/css"/><script type="text/javascript" src="lpdoc.js"></script><title>File path names &mdash; The Ciao System v1.22</title></head><body><div class="lpdoc-page fixleftbar"><a href="#" id="sidebar-toggle-button" class="lpdoc-navbutton"><span id="sidebar-button-arrow">&#9776;</span></a><div id="sidebar" class="lpdoc-sidebar"><div style="height: 40px; margin-left: auto; margin-right: auto"><img src="ciao-logo_autofig.png" width=auto height=100%></div><div class="lpdoc-nav"><span class="lpdoc-on-right"><a class="lpdoc-navbutton" href="StdLibs.html">&#x2191;</a><a class="lpdoc-navbutton" href="system.html">&#x2190;</a><a class="lpdoc-navbutton" href="process.html">&#x2192;</a><a class="lpdoc-navbutton" href="ciaosearch.html">&#x1F50D;</a></span><span><a href="ciaofulltoc.html">TOC</a></span></div><hr></hr><ul class="lpdoc-itemize-sectpath"><li><a href="ciao.html">The Ciao System</a> &raquo;<br/> </li><li><a href="StdLibs.html">PART VII - Standard libraries</a> &raquo;<br/> </li><li><a href=""><strong>File path names</strong></a></li></ul><hr></hr><em>ON THIS PAGE</em><ul><li><a href="#Usage and interface">Usage and interface</a></li><li><a href="#Documentation on exports">Documentation on exports</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>File path names</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#pathnames"></a> <strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Jose F. Morales" href="ciaosearch.html#Jose F. Morales">Jose F. Morales</a>.<p> A <a class="lpdoc-idx-anchor" id="0" href="ciaosearch.html#pathname">pathname</a> is an symbolic identifier that locates a file in a filesystem (e.g., <tt>foo/bar/baz.txt</tt>). This module provides predicates to manipulate pathnames, encoded as atoms. No file system access is required for pathname manipulation.<br/><div id="Usage and interface"><h2>Usage and interface</h2><div class="lpdoc-cartouche"><ul><li><strong>Library usage:</strong><br/><tt>:- use_module(library(pathnames)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="1" href="#path_is_absolute/1"><tt>path_is_absolute/1</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#path_is_relative/1"><tt>path_is_relative/1</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#path_is_basename/1"><tt>path_is_basename/1</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#path_is_root/1"><tt>path_is_root/1</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#path_concat/3"><tt>path_concat/3</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="#path_split/3"><tt>path_split/3</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#path_norm/2"><tt>path_norm/2</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="#path_splitext/3"><tt>path_splitext/3</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="#path_basename/2"><tt>path_basename/2</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="#path_dirname/2"><tt>path_dirname/2</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="#path_relocate/4"><tt>path_relocate/4</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="#path_get_relative/3"><tt>path_get_relative/3</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="#path_split_list/2"><tt>path_split_list/2</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="#path_concat_list/2"><tt>path_concat_list/2</tt></a>. <li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="15" href="#pathname/1"><tt>pathname/1</tt></a>. </ul></ul></div></div><div id="Documentation on exports"><h2>Documentation on exports</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="pathname/1" href="ciaosearch.html#pathname/1">pathname/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>pathname(X)</tt> </span><p><span class="lpdoc-var">X</span> is a pathname (encoded as an atom)</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_is_absolute/1" href="ciaosearch.html#path_is_absolute/1">path_is_absolute/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_is_absolute(Path)</tt> </span><p><span class="lpdoc-var">Path</span> is an absolute pathname</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="16" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="17" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_is_relative/1" href="ciaosearch.html#path_is_relative/1">path_is_relative/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_is_relative(Path)</tt> </span><p><span class="lpdoc-var">Path</span> is a relative pathname</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="18" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="19" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_is_basename/1" href="ciaosearch.html#path_is_basename/1">path_is_basename/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_is_basename(Path)</tt> </span><p><span class="lpdoc-var">Path</span> is a basename (empty directory part) (equivalent to <tt>path_split(Path, &apos;&apos;, _)</tt></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="20" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="21" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_is_root/1" href="ciaosearch.html#path_is_root/1">path_is_root/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_is_root(Path)</tt> </span><p><span class="lpdoc-var">Path</span> is a root directory (normalized into <tt>/</tt> or <tt>//</tt>) (equivalent to <tt>+ Path = &apos;&apos;, path_split(Path, Path, &apos;&apos;)</tt></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="22" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="23" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_concat/3" href="ciaosearch.html#path_concat/3">path_concat/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_concat(PathA,PathB,Path)</tt> </span><p>Concatenate pathnames <span class="lpdoc-var">PathA</span> and <span class="lpdoc-var">PathB</span> in a new path <span class="lpdoc-var">Path</span>, adding a <tt>/</tt> separator if needed. If <span class="lpdoc-var">PathB</span> is <tt>&apos;&apos;</tt>, then <span class="lpdoc-var">Path</span> is a <tt>/</tt> ended path. If <span class="lpdoc-var">PathB</span> is an absolute pathname, <span class="lpdoc-var">Path</span> is <span class="lpdoc-var">PathB</span>. No pathname normalization is performed in any case.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="24" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">PathA</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="25" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">PathB</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="26" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="27" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">PathA</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="28" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">PathB</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_split/3" href="ciaosearch.html#path_split/3">path_split/3</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>path_split(Path,Dir,Base)</tt> </span><p>Given a pathname <span class="lpdoc-var">Path</span>, <span class="lpdoc-var">Base</span> is the last component of the path and <span class="lpdoc-var">Dir</span> is the rest of the path. The following rules must hold:<p><ul> <li>All trailing slashes from <span class="lpdoc-var">Dir</span> are removed (except if it is a root directory containing one or more slashes, e.g., <tt>&apos;/&apos;</tt>, <tt>&apos;//&apos;</tt>). <li>If <span class="lpdoc-var">Path</span> ends in a slash (<tt>&apos;</tt>...<tt>/&apos;</tt>, <span class="lpdoc-var">Base</span> is empty (<tt>&apos;&apos;</tt>). <li>If <span class="lpdoc-var">Path</span> is empty, both <span class="lpdoc-var">Dir</span> and <span class="lpdoc-var">Base</span> are empty. <li>Concatenating <span class="lpdoc-var">Dir</span> and <span class="lpdoc-var">Base</span> results in pathname that is equivalent (modulo normalization) to <span class="lpdoc-var">Path</span>. That is, for all <span class="lpdoc-var">A</span>, <span class="lpdoc-var">B</span>, <span class="lpdoc-var">C</span>: <pre class="lpdoc-codeblock"> path_split(A,B,C), path_concat(B,C,D), path_norm(A,An), path_norm(D,Dn), An = Dn. </pre> </ul><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_split(Path,Dir,Base)</tt> </span><p>Split <span class="lpdoc-var">Path</span> into the directory part <span class="lpdoc-var">Dir</span> and the basename part <span class="lpdoc-var">Base</span>.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="29" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="30" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Dir</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="31" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Base</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="32" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="33" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Dir</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_norm/2" href="ciaosearch.html#path_norm/2">path_norm/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>path_norm(Path,NormPath)</tt> </span><p><span class="lpdoc-var">NormPath</span> is the normalized pathname version of <span class="lpdoc-var">Path</span>. Normalization removes redundant separators (<tt>//</tt> into <tt>/</tt>), and collapses references to the parent (<tt>..</tt>) and current (<tt>.</tt>) level. The parent of a root path (<tt>/</tt> or <tt>//</tt>) is itself. Empty paths (<tt>&apos;&apos;</tt>) or relative paths where all parent references are collapsed are normalized as <tt>&apos;.&apos;</tt>.<p>For compatibility, leading double-slashes are preserved in normalization (the POSIX.2 standard states that &quot;a pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash.&quot;). Some systems (like Linux) ignore double-slashes while others (like Cygwin for <tt>//hostname/path</tt> SMB network drives) do not.<p>Note that <a class="lpdoc-idx-anchor" id="34" href="#path_norm/2"><tt>path_norm/2</tt></a> does not access the filesystem, which may affect the semantics when symbolic links are used (and no path normalization is involved). E.g., the following query obtain different values for <span class="lpdoc-var">S1</span> and <span class="lpdoc-var">S2</span>:<p><pre class="lpdoc-codeblock">?- P = &apos;/usr/donotexists/..&apos;, path_norm(P, N), process_call(path(test), [&apos;-e&apos;, P], [status(S1)]), process_call(path(test), [&apos;-e&apos;, N], [status(S2)]). N = &apos;/usr&apos;, P = &apos;/usr/donotexists/..&apos;, S1 = 1, S2 = 0 ? ?- use_module(library(process)). ?- copy_file(&apos;/usr&apos;, &apos;u&apos;, [symlink]), P = &apos;u/../u&apos;, path_norm(P, N), process_call(path(test), [&apos;-e&apos;, P], [status(S1)]), process_call(path(test), [&apos;-e&apos;, N], [status(S2)]), delete_file(&apos;u&apos;). N = u, P = &apos;u/../u&apos;, S1 = 1, S2 = 0 ? yes </pre> <p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_norm(Path,NormPath)</tt> </span><p><span class="lpdoc-var">NormPath</span> is the normalized pathname version of <span class="lpdoc-var">Path</span>.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="35" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="36" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">NormPath</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="37" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_splitext/3" href="ciaosearch.html#path_splitext/3">path_splitext/3</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>path_splitext(Path,NoExt,Ext)</tt> </span><p>The extension <span class="lpdoc-var">Ext</span> is the shortest suffix that begins with <tt>&apos;.&apos;</tt> of <span class="lpdoc-var">Path</span>. The rest of the pathname is <span class="lpdoc-var">NoExt</span>, which cannot be empty (<tt>&apos;&apos;</tt>). The extension is <tt>&apos;&apos;</tt> if the pathname has no extension.<p>In this example, all the following goals succeed: <pre class="lpdoc-codeblock">path_splitext(&apos;a/foo.&apos;, &apos;a/foo&apos;, &apos;.&apos;) path_splitext(&apos;a/foo.c&apos;, &apos;a/foo&apos;, &apos;.c&apos;) path_splitext(&apos;a/foo.c.d&apos;, &apos;a/foo.c&apos;, &apos;.d&apos;) path_splitext(&apos;a/.foo.&apos;, &apos;a/.foo&apos;, &apos;.&apos;) path_splitext(&apos;a/.foo.c&apos;, &apos;a/.foo&apos;, &apos;.c&apos;) path_splitext(&apos;a/.foo.c.d&apos;, &apos;a/.foo.c&apos;, &apos;.d&apos;) </pre><p><span class="lpdoc-usage-header">Usage 1:</span><span class="lpdoc-usage-decl"><tt>path_splitext(Path,NoExt,Ext)</tt> </span><p>Split <span class="lpdoc-var">Path</span> into its extension <span class="lpdoc-var">Ext</span> and the rest of the pathname <span class="lpdoc-var">NoExt</span>.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="38" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="39" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">NoExt</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="40" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Ext</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="41" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span> </ul><p><span class="lpdoc-usage-header">Usage 2:</span><span class="lpdoc-usage-decl"><tt>path_splitext(Path,NoExt,Ext)</tt> </span><p>Compose <span class="lpdoc-var">Path</span> by concatenating the extension <span class="lpdoc-var">Ext</span> to <span class="lpdoc-var">NoExt</span> pathname.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="42" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="43" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">NoExt</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="44" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Ext</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="45" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">NoExt</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="46" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Ext</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_basename/2" href="ciaosearch.html#path_basename/2">path_basename/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_basename(Path,Base)</tt> </span><p><span class="lpdoc-var">Base</span> is the basename corresponding to the <span class="lpdoc-var">Path</span> (equivalent to <tt>path_split(Path,_,Base)</tt>).</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="47" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="48" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Base</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="49" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_dirname/2" href="ciaosearch.html#path_dirname/2">path_dirname/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_dirname(Path,Dir)</tt> </span><p><span class="lpdoc-var">Dir</span> is the directory part corresponding to the <span class="lpdoc-var">Path</span> (equivalent to <tt>path_split(Path,Dir,_)</tt>).</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="50" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="51" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Dir</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="52" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_relocate/4" href="ciaosearch.html#path_relocate/4">path_relocate/4</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_relocate(FromDir,ToDir,FromPath,ToPath)</tt> </span><p>Replace <span class="lpdoc-var">FromDir</span> prefix by <span class="lpdoc-var">DestDir</span> in <span class="lpdoc-var">FromDir</span> to generate <span class="lpdoc-var">ToDir</span></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="53" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">FromDir</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="54" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">ToDir</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="55" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">FromPath</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="56" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">ToPath</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="57" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">FromDir</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="58" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">ToDir</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="59" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">FromPath</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="60" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">ToPath</span> is a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_get_relative/3" href="ciaosearch.html#path_get_relative/3">path_get_relative/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_get_relative(BaseDir,Path,RelPath)</tt> </span><p>Obtain path <span class="lpdoc-var">RelPath</span> such that <tt>path_concat(BaseDir, RelPath, Path)</tt> <span class="lpdoc-var">RelPath</span> will not contain any trailing <tt>&apos;/&apos;</tt></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="61" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">BaseDir</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="62" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="63" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">RelPath</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="64" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">BaseDir</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="65" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="66" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">RelPath</span> is a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_split_list/2" href="ciaosearch.html#path_split_list/2">path_split_list/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_split_list(Path,Bases)</tt> </span><p>Split <span class="lpdoc-var">Path</span> into its components <span class="lpdoc-var">Bases</span>, calling <a class="lpdoc-idx-anchor" id="67" href="#path_split/3"><tt>path_split/3</tt></a> recursively.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="68" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="69" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Bases</span> is a list of <span class="lpdoc-var">pathname</span>s. </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="70" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="path_concat_list/2" href="ciaosearch.html#path_concat_list/2">path_concat_list/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>path_concat_list(Bases,Path)</tt> </span><p>Concatenate all components in <span class="lpdoc-var">Bases</span> a new path <span class="lpdoc-var">Path</span>, calling <a class="lpdoc-idx-anchor" id="71" href="#path_concat/3"><tt>path_concat/3</tt></a> recursively. </p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="72" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Bases</span> is a list of <span class="lpdoc-var">pathname</span>s. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="73" href="#pathname/1"><tt>pathnames:pathname/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a pathname (encoded as an atom) </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="74" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Bases</span> is currently a term which is not a free variable. </span> </ul></div></div><p> </div><div id="Documentation on imports"><h2>Documentation on imports</h2>This module has the following direct dependencies:<ul class="lpdoc-itemize-minus"><li><em>System library modules:</em><br/><a class="lpdoc-idx-anchor" id="75" href="ciaosearch.html#native_props"><tt>native_props</tt></a>, <a class="lpdoc-idx-anchor" id="76" href="lists.html"><tt>lists</tt></a>, <a class="lpdoc-idx-anchor" id="77" href="system.html"><tt>system</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="78" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="79" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="80" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="81" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="82" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="83" href="isomodes_doc.html"><tt>isomodes</tt></a>, <a class="lpdoc-idx-anchor" id="84" href="ciaosearch.html#nativeprops"><tt>nativeprops</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>