-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.randomseed.utils.fs.html
15 lines (15 loc) · 18.6 KB
/
io.randomseed.utils.fs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>io.randomseed.utils.fs documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Random:utils</span> <span class="project-version">1.2.34</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>io</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>randomseed</span></div></div></li><li class="depth-3"><a href="io.randomseed.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bot.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bot</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bus.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bus</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.crypto.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>crypto</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.db.types.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></a></li><li class="depth-4 branch current"><a href="io.randomseed.utils.fs.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>fs</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ip</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.log.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>log</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.map.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>map</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.nop-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>nop-cache</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>reitit</span></div></div></li><li class="depth-5"><a href="io.randomseed.utils.reitit.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.set.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>set</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.time.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>time</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.validators.common.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.var.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>var</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.vec.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vec</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-abs-pathname"><div class="inner"><span>abs-pathname</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-absolute-path.3F"><div class="inner"><span>absolute-path?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-basename"><div class="inner"><span>basename</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-empty-str-ary"><div class="inner"><span>empty-str-ary</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-exists.3F"><div class="inner"><span>exists?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-extension"><div class="inner"><span>extension</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-file"><div class="inner"><span>file</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-get-java-classpath-folders"><div class="inner"><span>get-java-classpath-folders</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-get-java-property"><div class="inner"><span>get-java-property</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-home-dir-pathname"><div class="inner"><span>home-dir-pathname</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-mapv-java-properties"><div class="inner"><span>mapv-java-properties</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-parse-java-properties"><div class="inner"><span>parse-java-properties</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-parse-java-property"><div class="inner"><span>parse-java-property</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-prop-pathname"><div class="inner"><span>prop-pathname</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-prop-regex"><div class="inner"><span>prop-regex</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-read-lines"><div class="inner"><span>read-lines</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-read-preferences"><div class="inner"><span>read-preferences</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-relative-path.3F"><div class="inner"><span>relative-path?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-resource-exists.3F"><div class="inner"><span>resource-exists?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-resource-file"><div class="inner"><span>resource-file</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-resource-pathname"><div class="inner"><span>resource-pathname</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-user-dir-pathname"><div class="inner"><span>user-dir-pathname</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-with-ns-loading"><div class="inner"><span>with-ns-loading</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.fs.html#var-write-preferences"><div class="inner"><span>write-preferences</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">io.randomseed.utils.fs</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>Random utils, filesystem utilities.</p>
</div></div><div class="public anchor" id="var-abs-pathname"><h3>abs-pathname</h3><div class="usage"><code>(abs-pathname path)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L101">view source</a></div></div><div class="public anchor" id="var-absolute-path.3F"><h3>absolute-path?</h3><div class="usage"><code>(absolute-path? pathname)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L26">view source</a></div></div><div class="public anchor" id="var-basename"><h3>basename</h3><div class="usage"><code>(basename f)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L89">view source</a></div></div><div class="public anchor" id="var-empty-str-ary"><h3>empty-str-ary</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L22">view source</a></div></div><div class="public anchor" id="var-exists.3F"><h3>exists?</h3><div class="usage"><code>(exists? filename)</code></div><div class="doc"><div class="markdown"><p>Returns true if the file exists.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L150">view source</a></div></div><div class="public anchor" id="var-extension"><h3>extension</h3><div class="usage"><code>(extension f)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L94">view source</a></div></div><div class="public anchor" id="var-file"><h3>file</h3><div class="usage"><code>(file fname)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L84">view source</a></div></div><div class="public anchor" id="var-get-java-classpath-folders"><h3>get-java-classpath-folders</h3><div class="usage"><code>(get-java-classpath-folders)</code></div><div class="doc"><div class="markdown"><p>Lists all directories the exist in Java classpath as a sequence of strings. Returns nil if there are none.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L34">view source</a></div></div><div class="public anchor" id="var-get-java-property"><h3>get-java-property</h3><div class="usage"><code>(get-java-property s)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L155">view source</a></div></div><div class="public anchor" id="var-home-dir-pathname"><h3>home-dir-pathname</h3><div class="usage"><code>(home-dir-pathname)</code><code>(home-dir-pathname & paths)</code></div><div class="doc"><div class="markdown"><p>For the given pathnames creates a pathname expressed as a string by prefixing them with user’s home directory obtained from the Java property <code>user.dir</code> with all parts joined using current path name separator.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L57">view source</a></div></div><div class="public anchor" id="var-mapv-java-properties"><h3>mapv-java-properties</h3><div class="usage"><code>(mapv-java-properties v)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L172">view source</a></div></div><div class="public anchor" id="var-parse-java-properties"><h3>parse-java-properties</h3><div class="usage"><code>(parse-java-properties s)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L168">view source</a></div></div><div class="public anchor" id="var-parse-java-property"><h3>parse-java-property</h3><div class="usage"><code>(parse-java-property s)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L162">view source</a></div></div><div class="public anchor" id="var-prop-pathname"><h3>prop-pathname</h3><div class="usage"><code>(prop-pathname prop)</code><code>(prop-pathname prop paths)</code></div><div class="doc"><div class="markdown"><p>For the given Java property name and optional path names creates a path name expressed as a string by prefixing them with the directory obtained from a property with all parts joined using pathname separator.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L40">view source</a></div></div><div class="public anchor" id="var-prop-regex"><h3>prop-regex</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L160">view source</a></div></div><div class="public anchor" id="var-read-lines"><h3>read-lines</h3><div class="usage"><code>(read-lines filename)</code><code>(read-lines n filename)</code></div><div class="doc"><div class="markdown"><p>Read first n lines from a file. If the pathname is relative it will be relative to user’s home directory.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L139">view source</a></div></div><div class="public anchor" id="var-read-preferences"><h3>read-preferences</h3><div class="usage"><code>(read-preferences filename)</code></div><div class="doc"><div class="markdown"><p>Reads the given preferences file. If the path is relative it will be relative to user’s home directory.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L124">view source</a></div></div><div class="public anchor" id="var-relative-path.3F"><h3>relative-path?</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L31">view source</a></div></div><div class="public anchor" id="var-resource-exists.3F"><h3>resource-exists?</h3><div class="usage"><code>(resource-exists? r)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L80">view source</a></div></div><div class="public anchor" id="var-resource-file"><h3>resource-file</h3><div class="usage"><code>(resource-file resource)</code></div><div class="doc"><div class="markdown"><p>Returns a java.io.File object for the existing resource of the given name.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L74">view source</a></div></div><div class="public anchor" id="var-resource-pathname"><h3>resource-pathname</h3><div class="usage"><code>(resource-pathname)</code><code>(resource-pathname & paths)</code></div><div class="doc"><div class="markdown"><p>For the given pathnames creates a pathname expressed as a string which resides within one of the Java resource directories. The path must exist to be returned.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L64">view source</a></div></div><div class="public anchor" id="var-user-dir-pathname"><h3>user-dir-pathname</h3><div class="usage"><code>(user-dir-pathname)</code><code>(user-dir-pathname & paths)</code></div><div class="doc"><div class="markdown"><p>For the given pathnames creates a pathname expressed as a string by prefixing them with user’s directory (typically a project directory) obtained from the Java property <code>user.dir</code> with all parts joined using current path name separator.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L49">view source</a></div></div><div class="public anchor" id="var-with-ns-loading"><h3>with-ns-loading</h3><div class="usage"><code>(with-ns-loading op k & more)</code><code>(with-ns-loading k)</code></div><div class="doc"><div class="markdown"><p>Executes the given function op and passes it a key or a sequence given as k and additional, optional arguments. Before that happens it will get all identifiers from the sequence (or check if the given single k is an identifier) and try to load their namespaces if the identifier(s) is/are fully qualified.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L108">view source</a></div></div><div class="public anchor" id="var-write-preferences"><h3>write-preferences</h3><div class="usage"><code>(write-preferences filename data)</code></div><div class="doc"><div class="markdown"><p>Writes the given preference file. If the path is relative it will be relative to user’s home directory.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/fs.clj#L131">view source</a></div></div></div></body></html>