UNPKG

qminer

Version:

A C++ based data analytics platform for processing large-scale real-time streams containing structured and unstructured data

1,210 lines (1,206 loc) 48.6 kB
<!doctype html> <html> <head> <meta name="generator" content="JSDoc 3"> <meta charset="utf-8"> <title>Module: fs</title> <link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css"> <link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css"> <link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css"> <link href="css/baseline.css" rel="stylesheet"> </head> <body onload="prettyPrint()"> <nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar"> <div id="jsdoc-navbar-container"> <div id="jsdoc-navbar-content"> <a href="index.html" class="jsdoc-navbar-package-name">QMiner JavaScript API v9.4.0</a> </div> </div> </nav> <div id="jsdoc-body-container"> <div id="jsdoc-content"> <div id="jsdoc-content-container"> <div id="jsdoc-main" role="main"> <header class="page-header"> <div class="symbol-detail-labels"><span class="label label-kind">module</span></div> <h1><small></small><span class="symbol-name">fs</span></h1> <p class="source-link">Source: <a href="fsdoc.js.html#source-line-8">fsdoc.<wbr>js:8</a></p> <div class="symbol-description"> <p>File-system module.</p> </div> <section> <h2> Example </h2> <div> <pre class="prettyprint"><code>// import module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // open file in write mode var fout &#x3D; fs.openWrite(&#x27;file.txt&#x27;); // write sync and close fout.writeLine(&#x27;example text&#x27;); fout.close(); // open file in read mode var fin &#x3D; fs.openRead(&#x27;file.txt&#x27;); // read a line var str &#x3D; fin.readLine();</code></pre> </div> </section> <dl class="dl-compact"> </dl> </header> <section id="summary"> <div class="summary-callout"> <h2 class="summary-callout-heading">Child classes</h2> <div class="summary-content"> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-fs.FIn.html">FIn(fileName)</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-fs.FOut.html">FOut(fileName[, append])</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> </div> </div> </div> <div class="summary-callout"> <h2 class="summary-callout-heading">Methods</h2> <div class="summary-content"> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-fs.html#.copy">copy(source, dest)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.del">del(fileName)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.exists">exists(fileName)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.fileInfo">fileInfo(fileName)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.listFile">listFile(dirName[, fileExtension][, recursive])</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-fs.html#.mkdir">mkdir(dirName)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.move">move(source, dest)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.openAppend">openAppend(fileName)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.openRead">openRead(fileName)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.openWrite">openWrite(fileName)</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-fs.html#.readCsvLines">readCsvLines(buffer, opts)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.readLines">readLines(buffer, onLine(line), onEnd(err))</a></dt> <dd> </dd> <dt><a href="module-fs.html#.rename">rename(source, dest)</a></dt> <dd> </dd> <dt><a href="module-fs.html#.rmdir">rmdir(dirName)</a></dt> <dd> </dd> </dl> </div> </div> </div> <div class="summary-callout"> <h2 class="summary-callout-heading">Abstract type</h2> <div class="summary-content"> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-fs.html#~FileInfo">FileInfo</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> </div> <div class="summary-column"> </div> </div> </div> </section> <section> <h2>Classes</h2> <section id='members-links'> <h3><a href="module-fs.FIn.html">FIn</a></h3> <h3><a href="module-fs.FOut.html">FOut</a></h3> </section> <h2>Methods</h2> <section> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".copy"><span class="symbol-name">copy</span><span class="signature"><span class="signature-params">(source, dest)</span></span></h3> <p>Copies a file.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // open file to write var fout &#x3D; fs.openWrite(&#x27;text.txt&#x27;); // close the stream fout.close(); // copy the file // var destination &#x3D; fs.copy(&#x27;text.txt&#x27;, &#x27;copy.txt&#x27;);</code></pre> </div> </section> <section> <h4>Parameters</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>source</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Source file name.</p> </td> </tr> <tr> <td> <p>dest</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Destination file name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".del"><span class="symbol-name">del</span><span class="signature"><span class="signature-params">(fileName)</span>&nbsp;&rarr; <span class="signature-returns"> boolean</span></span></h3> <p>Deletes a file.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // open file to write var fout &#x3D; fs.openWrite(&#x27;delete.txt&#x27;); // close the stream fout.close(); // delete the file var destination &#x3D; fs.del(&#x27;delete.txt&#x27;);</code></pre> </div> </section> <section> <h4>Parameter</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>fileName</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>File name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd> <p><code>boolean</code>B True if delete succeeded.</p> </dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".exists"><span class="symbol-name">exists</span><span class="signature"><span class="signature-params">(fileName)</span>&nbsp;&rarr; <span class="signature-returns"> boolean</span></span></h3> <p>Checks if the file exists.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // check if a file exists fs.exists(&#x27;text.txt&#x27;);</code></pre> </div> </section> <section> <h4>Parameter</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>fileName</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>File name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd> <p><code>boolean</code>B True if file exists.</p> </dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".fileInfo"><span class="symbol-name">fileInfo</span><span class="signature"><span class="signature-params">(fileName)</span>&nbsp;&rarr; <span class="signature-returns"> <a href="module-fs.html#~FileInfo">module:fs~FileInfo</a></span></span></h3> <p>Returns the file info.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // open file to write var fout &#x3D; fs.openWrite(&#x27;text.txt&#x27;); // close the stream fout.close(); // get the file info var info &#x3D; fs.fileInfo(&#x27;text.txt&#x27;);</code></pre> </div> </section> <section> <h4>Parameter</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>fileName</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>File name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd> <p><code><a href="module-fs.html#~FileInfo">module:fs~FileInfo</a></code>B File info object.</p> </dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".listFile"><span class="symbol-name">listFile</span><span class="signature"><span class="signature-params">(dirName[, fileExtension][, recursive])</span>&nbsp;&rarr; <span class="signature-returns"> Array of string</span></span></h3> <p>Returns a list fo files in the folder.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // get the names of all files var fileNames &#x3D; fs.listFile(&#x27;./&#x27;);</code></pre> </div> </section> <section> <h4>Parameters</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>dirName</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Folder name.</p> </td> </tr> <tr> <td> <p>fileExtension</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>Results are filtered by file extension.</p> </td> </tr> <tr> <td> <p>recursive</p> </td> <td> <p>boolean</p> </td> <td> <p>Yes</p> </td> <td> <p>Recursively searches for file names if true.</p> <p>Defaults to <code>false</code>.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd> <p><code>Array of string</code>B Array of file names.</p> </dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".mkdir"><span class="symbol-name">mkdir</span><span class="signature"><span class="signature-params">(dirName)</span>&nbsp;&rarr; <span class="signature-returns"> boolean</span></span></h3> <p>Creates a folder.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // create a folder var makeFolder &#x3D; fs.mkdir(&#x27;folder&#x27;);</code></pre> </div> </section> <section> <h4>Parameter</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>dirName</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Folder name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd> <p><code>boolean</code>B True if succeeded.</p> </dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".move"><span class="symbol-name">move</span><span class="signature"><span class="signature-params">(source, dest)</span></span></h3> <p>Moves a file.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // open file to write var fout &#x3D; fs.openWrite(&#x27;text.txt&#x27;); // close the stream fout.close(); // move the file // var destination &#x3D; fs.move(&#x27;text.txt&#x27;, &#x27;move.txt&#x27;);</code></pre> </div> </section> <section> <h4>Parameters</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>source</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Source file name.</p> </td> </tr> <tr> <td> <p>dest</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Destination file name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".openAppend"><span class="symbol-name">openAppend</span><span class="signature"><span class="signature-params">(fileName)</span>&nbsp;&rarr; <span class="signature-returns"> <a href="module-fs.FOut.html">module:fs.FOut</a></span></span></h3> <p>Open file in append mode and return file output stream.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // open file to write var fout &#x3D; fs.openWrite(&#x27;append_text.txt&#x27;); // close the stream fout.close(); // open file in append mode var foutAppend &#x3D; fs.openAppend(&#x27;append_text.txt&#x27;); // close the stream foutAppend.close();</code></pre> </div> </section> <section> <h4>Parameter</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>fileName</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>File name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd> <p><code><a href="module-fs.FOut.html">module:fs.FOut</a></code>B Output stream.</p> </dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".openRead"><span class="symbol-name">openRead</span><span class="signature"><span class="signature-params">(fileName)</span>&nbsp;&rarr; <span class="signature-returns"> <a href="module-fs.FIn.html">module:fs.FIn</a></span></span></h3> <p>Open file in read mode and return file input stream.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // open file to write var fout &#x3D; fs.openWrite(&#x27;read_text.txt&#x27;); // write to file fout.write(&#x27;This is awesome!&#x27;); // close the stream fout.close(); // open file to read var fin &#x3D; fs.openRead(&#x27;read_text.txt&#x27;);</code></pre> </div> </section> <section> <h4>Parameter</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>fileName</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>File name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd> <p><code><a href="module-fs.FIn.html">module:fs.FIn</a></code>B Input stream.</p> </dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".openWrite"><span class="symbol-name">openWrite</span><span class="signature"><span class="signature-params">(fileName)</span>&nbsp;&rarr; <span class="signature-returns"> <a href="module-fs.FOut.html">module:fs.FOut</a></span></span></h3> <p>Open file in write mode and return file output stream.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // open file to write var fout &#x3D; fs.openWrite(&#x27;write_text.txt&#x27;); // close the stream fout.close();</code></pre> </div> </section> <section> <h4>Parameter</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>fileName</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>File name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd> <p><code><a href="module-fs.FOut.html">module:fs.FOut</a></code>B Output stream.</p> </dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".readCsvLines"><span class="symbol-name">readCsvLines</span><span class="signature"><span class="signature-params">(buffer, opts)</span></span></h3> <p>Reads a buffer, containing a CSV file, line by line and calls a callback for each line. As specified in CSV format standard defined in <a href="https://tools.ietf.org/html/rfc4180">RFC 4180</a> double-quotes (&quot;) can be used as escape characters. If a double-quote appears in a field, the field nust be enclosed in double-quotes and the double-quote appearing inside a field must be escaped by preceding it with another double quote. The callback function accepts an array with the values of the current line.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module let fs &#x3D; require(&#x27;qminer&#x27;).fs; // create a file and write some lines let fout &#x3D; fs.openWrite(&#x27;test.csv&#x27;); fout.write(&#x27;name,movie\nGeorge Clooney,&quot;O Brother, Where Art Thou?&quot;\n&quot;Sylvester &quot;&quot;Sly&quot;&quot; Stallone&quot;,Expendables&#x27;); fout.close(); // open the file in read mode let fin &#x3D; fs.openRead(&#x27;test.csv&#x27;); // prepare callbacks for csv parsing // count the lines and for each line output the parsed cells let nLines &#x3D; 0; function onLine(lineVals) { nLines +&#x3D; 1; console.log(lineVals); return true; } // at the end output the number of lines function onEnd(err) { if (err) { console.log(&quot;Error:&quot;, err); } console.log(&quot;Number of lines&quot;, nLines); } // parse the csv files fs.readCsvLines(fin, { &quot;onLine&quot;: onLine, &quot;onEnd&quot;: onEnd }); </code></pre> </div> </section> <section> <h4>Parameters</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>buffer</p> </td> <td> <p>Buffer</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The Node.js buffer.</p> </td> </tr> <tr> <td> <p>opts</p> </td> <td> <p>Object</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Options parameter.</p> <p>Values in <code>opts</code> have the following properties:</p> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>onLine</p> </td> <td> <p>function()</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>A callback that gets called on each line (for example: <code>function (lineArr) {}</code>).</p> </td> </tr> <tr> <td> <p>onEnd</p> </td> <td> <p>function()</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>A callback that gets returned after all the lines have been read.</p> </td> </tr> <tr> <td> <p>delimiter</p> </td> <td> <p>String</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The delimiter used when parsing.</p> </td> </tr> <tr> <td> <p>lineLimit</p> </td> <td> <p>Number</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The maximum number of lines read.</p> </td> </tr> <tr> <td> <p>skipLines</p> </td> <td> <p>Number</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The number of lines that should be skipped before first calling the callback.</p> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".readLines"><span class="symbol-name">readLines</span><span class="signature"><span class="signature-params">(buffer, onLine(line), onEnd(err))</span></span></h3> <p>Reads a buffer line by line and calls a callback for each line.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // create a file and write some lines var fout &#x3D; fs.openWrite(&#x27;poem.txt&#x27;); fout.write(&#x27;I dig,\nYou dig,\nHe digs,\nShe digs,\nWe dig,\nThey dig.\n It\&#x27;s not a beautiful poem, but it\&#x27;s deep.&#x27;); fout.close(); // open the file in read mode var fin &#x3D; fs.openRead(&#x27;poem.txt&#x27;); // read the file line by line and call functions var numberOfLines &#x3D; 0; function onLine(line) { console.log(line); numberOfLines +&#x3D; 1; return true; } function onEnd(err) { if (err) { console.log(&quot;Error:&quot;, err); } console.log(&quot;Number of lines&quot;, numberOfLines); } fs.readLines(fin, onLine, onEnd);</code></pre> </div> </section> <section> <h4>Parameters</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>buffer</p> </td> <td> <p>(String, <a href="module-fs.FIn.html">module:fs.FIn</a>, or Buffer)</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Name of the file, input stream of a Node.js buffer.</p> </td> </tr> <tr> <td> <p>onLine(line)</p> </td> <td> <p>function()</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>A callback that gets called on each line (for example: <code>function (line) {}</code>). Function must return <code>true</code> to continue reading, else reading is stoped and <code>onEnd</code> is called.</p> </td> </tr> <tr> <td> <p>onEnd(err)</p> </td> <td> <p>function()</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>A callback that gets returned after all the lines have been read or function <code>onLine</code> returned <code>false</code>. If error was due to exception, the exception is provided in <code>err</code>.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".rename"><span class="symbol-name">rename</span><span class="signature"><span class="signature-params">(source, dest)</span></span></h3> <p>Renames a file.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // open file to write var fout &#x3D; fs.openWrite(&#x27;text.txt&#x27;); // close the stream fout.close(); // rename the file if (fs.exists(&#x27;rename.txt&#x27;)) { fs.del(&#x27;rename.txt&#x27;); } var destination &#x3D; fs.rename(&#x27;text.txt&#x27;, &#x27;rename.txt&#x27;);</code></pre> </div> </section> <section> <h4>Parameters</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>source</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Source file name.</p> </td> </tr> <tr> <td> <p>dest</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Destination file name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div> <h3 id=".rmdir"><span class="symbol-name">rmdir</span><span class="signature"><span class="signature-params">(dirName)</span>&nbsp;&rarr; <span class="signature-returns"> boolean</span></span></h3> <p>Removes a folder.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import fs module var fs &#x3D; require(&#x27;qminer&#x27;).fs; // create a folder var makeFolder &#x3D; fs.mkdir(&#x27;folder&#x27;); // delete folder if (makeFolder) { fs.rmdir(&#x27;folder&#x27;); }</code></pre> </div> </section> <section> <h4>Parameter</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>dirName</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Folder name.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd> <p><code>boolean</code>B True if succeeded.</p> </dd> </dl> </section> <h2>Abstract type</h2> <section> <div class="symbol-detail-labels"><span class="label label-inner">inner</span></div> <h3 id="~FileInfo"><span class="symbol-name">FileInfo</span><small class="property-type"> &nbsp;Object</small></h3> <p>Information about the file.</p> <section> <h4>Properties</h4> <table class="jsdoc-details-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Optional</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <p>createTime</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Create time.</p> </td> </tr> <tr> <td> <p>lastAccessTime</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Last access time.</p> </td> </tr> <tr> <td> <p>lastWriteTime</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Last write time.</p> </td> </tr> <tr> <td> <p>size</p> </td> <td> <p>number</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>File size in bytes.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> </dl> </section> </section> </div> </div> <nav id="jsdoc-toc-nav" role="navigation"></nav> </div> </div> <footer id="jsdoc-footer" class="jsdoc-footer"> <div id="jsdoc-footer-container"> <p> </p> </div> </footer> <script src="scripts/jquery.min.js"></script> <script src="scripts/tree.jquery.js"></script> <script src="scripts/prettify.js"></script> <script src="scripts/jsdoc-toc.js"></script> <script src="scripts/linenumber.js"></script> <script src="scripts/scrollanchor.js"></script> </body> </html>