UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

18 lines 7.07 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>Manager for persistent data directories &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="persdb_rt.html">&#x2191;</a><a class="lpdoc-navbutton" href="persdb_examples.html">&#x2190;</a><a class="lpdoc-navbutton" href="factsdb_doc.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="ExtendLang.html">PART IV - Language extensions</a> &raquo;<br/> </li><li><a href="persdb_rt.html">Persistent predicate database</a> &raquo;<br/> </li><li><a href=""><strong>Manager for persistent data directories</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 multifiles">Documentation on multifiles</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Manager for persistent data directories</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#datadir"></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> This module abstracts the location of directories for storing persistent data.<p>The directory for persistent data will be placed under <a class="lpdoc-idx-anchor" id="0" href="#deploy_data_root_dir/1"><tt>deploy_data_root_dir/1</tt></a> (multifile) or inside the temporary build directory (see <a class="lpdoc-idx-anchor" id="1" href="ciaosearch.html#config_common:data_root_dir/1"><tt>config_common:data_root_dir/1</tt></a>.<p>See <a class="lpdoc-idx-anchor" id="2" href="#ensure_datadir/2"><tt>ensure_datadir/2</tt></a> for usage. This module is handy to select the directory for <a class="lpdoc-idx-anchor" id="3" href="ciaosearch.html#persdb"><tt>persdb</tt></a> databases, e.g.: <pre class="lpdoc-codeblock">persistent_dir(db, Dir) :- ensure_datadir(&apos;yourapp&apos;, Dir). </pre> <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(persdb/datadir)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="4" href="#ensure_datadir/2"><tt>ensure_datadir/2</tt></a>. <li><em>Multifiles:</em><br/><a class="lpdoc-idx-anchor" id="5" href="#deploy_data_root_dir/1"><tt>deploy_data_root_dir/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">PREDICATE</span><a class="lpdoc-idx-anchor" id="ensure_datadir/2" href="ciaosearch.html#ensure_datadir/2">ensure_datadir/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>ensure_datadir(RelPath,Path)</tt> </span><p>Obtain the absolute path <span class="lpdoc-var">Path</span> for storing persistent data under relative <span class="lpdoc-var">RelPath</span> directory. The directory is created if needed.</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="6" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">RelPath</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="7" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is 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="8" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">RelPath</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="9" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Path</span> is a free variable. </span> </ul></div></div><p> </div><div id="Documentation on multifiles"><h2>Documentation on multifiles</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="deploy_data_root_dir/1" href="ciaosearch.html#deploy_data_root_dir/1">deploy_data_root_dir/1</a></div><div class="lpdoc-deftext">Directory for persistent data on deployment. If this is a relative path, it will be placed under the <tt>HOME</tt> directory automatically. The predicate is <em>multifile</em>.<br/></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="10" href="datafacts_rt.html"><tt>datafacts_rt</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="pathnames.html"><tt>pathnames</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="system.html"><tt>system</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="system_extra.html"><tt>system_extra</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="ciaosearch.html#config_common"><tt>config_common</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="15" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="20" href="basicmodes_doc.html"><tt>basicmodes</tt></a>, <a class="lpdoc-idx-anchor" id="21" href="fsyntax_doc.html"><tt>fsyntax</tt></a>, <a class="lpdoc-idx-anchor" id="22" href="datafacts_doc.html"><tt>datafacts</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>