deploy: fbfb0807a91349e9a013c32158172f412ce8e714

gh-pages
TorchedSammy 2023-12-26 02:36:50 +00:00
parent e934498620
commit 412d47289e
1 changed files with 5 additions and 2 deletions

View File

@ -34,9 +34,12 @@ library offers more functions and will work on any operating system Hilbish does
</span></span><span class=line><span class=ln>2</span><span class=cl><span class=n>print</span><span class=p>(</span><span class=n>fs.join</span><span class=p>(</span><span class=n>hilbish.userDir</span><span class=p>.</span><span class=n>config</span><span class=p>,</span> <span class=s1>&#39;hilbish&#39;</span><span class=p>))</span>
</span></span><span class=line><span class=ln>3</span><span class=cl><span class=c1>-- -&gt; &#39;/home/user/.config/hilbish&#39; on Linux</span>
</span></span></code></pre></div></div><hr><div id=mkdir><h4 class=heading>fs.mkdir(name, recursive)
<a href=#mkdir class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Creates a new directory with the provided <code>name</code>.<br>With <code>recursive</code>, mkdir will create parent directories.<br>&ndash; This will create the directory foo, then create the directory bar in the<br>&ndash; foo directory. If recursive is false in this case, it will fail.<br>fs.mkdir(&rsquo;./foo/bar&rsquo;, true)</p><h5 id=parameters-6 class=heading>Parameters
<a href=#mkdir class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Creates a new directory with the provided <code>name</code>.<br>With <code>recursive</code>, mkdir will create parent directories.</p><h5 id=parameters-6 class=heading>Parameters
<a href=#parameters-6 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>string</code> <strong><code>name</code></strong><br>Name of the directory</p><p><code>boolean</code> <strong><code>recursive</code></strong><br>Whether to create parent directories for the provided name</p><h5 id=example-2 class=heading>Example
<a href=#example-2 class=heading-link><i class="fas fa-paperclip"></i></a></h5><div class=highlight><pre tabindex=0 class=chroma><code class=language-lua data-lang=lua></code></pre></div></div><hr><div id=readdir><h4 class=heading>fs.readdir(path) -> table[string]
<a href=#example-2 class=heading-link><i class="fas fa-paperclip"></i></a></h5><div class=highlight><pre tabindex=0 class=chroma><code class=language-lua data-lang=lua><span class=line><span class=ln>1</span><span class=cl><span class=c1>-- This will create the directory foo, then create the directory bar in the</span>
</span></span><span class=line><span class=ln>2</span><span class=cl><span class=c1>-- foo directory. If recursive is false in this case, it will fail.</span>
</span></span><span class=line><span class=ln>3</span><span class=cl><span class=n>fs.mkdir</span><span class=p>(</span><span class=s1>&#39;./foo/bar&#39;</span><span class=p>,</span> <span class=kc>true</span><span class=p>)</span>
</span></span></code></pre></div></div><hr><div id=readdir><h4 class=heading>fs.readdir(path) -> table[string]
<a href=#readdir class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Returns a list of all files and directories in the provided path.</p><h5 id=parameters-7 class=heading>Parameters
<a href=#parameters-7 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>string</code> <strong><code>dir</code></strong></p></div><hr><div id=stat><h4 class=heading>fs.stat(path) -> {}
<a href=#stat class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Returns the information about a given <code>path</code>.<br>The returned table contains the following values:<br>name (string) - Name of the path<br>size (number) - Size of the path in bytes<br>mode (string) - Unix permission mode in an octal format string (with leading 0)<br>isDir (boolean) - If the path is a directory</p><h5 id=parameters-8 class=heading>Parameters