<metaname="description"content="Archivers ENiGMA½ can detect and process various archive formats such as zip and arj for a variety of tasks from file upload processing to EchoMail bundle compress/decompression. The archives section of config.hjson is used to override defaults, add new handlers, and so on."/>
<metaproperty="og:description"content="Archivers ENiGMA½ can detect and process various archive formats such as zip and arj for a variety of tasks from file upload processing to EchoMail bundle compress/decompression. The archives section of config.hjson is used to override defaults, add new handlers, and so on."/>
{"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"/enigma-bbs/assets/images/enigma-logo.png"}},"description":"Archivers ENiGMA½ can detect and process various archive formats such as zip and arj for a variety of tasks from file upload processing to EchoMail bundle compress/decompression. The archives section of config.hjson is used to override defaults, add new handlers, and so on.","url":"/enigma-bbs/configuration/archivers.html","headline":"Archivers","@type":"BlogPosting","dateModified":"2023-04-25T16:28:49+00:00","datePublished":"2023-04-25T16:28:49+00:00","mainEntityOfPage":{"@type":"WebPage","@id":"/enigma-bbs/configuration/archivers.html"},"@context":"https://schema.org"}</script>
<aclass="btn"style="float:left;margin-right: 20px;"href="/enigma-bbs/configuration/external-binaries.html">« External Support Binaries</a>
<ahref="#sidebar"class="btn menu_button">MENU</a>
<aclass="btn"style="float: right;margin-left: 20px"href="/enigma-bbs/configuration/file-transfer-protocols.html">File Transfer Protocols »</a>
<brclear="both">
</div>
<divclass="page">
<h1class="page-title">Archivers</h1>
<h2id="archivers">Archivers</h2>
<p>ENiGMA½ can detect and process various archive formats such as zip and arj for a variety of tasks from file upload processing to EchoMail bundle compress/decompression. The <codeclass="language-plaintext highlighter-rouge">archives</code> section of <codeclass="language-plaintext highlighter-rouge">config.hjson</code> is used to override defaults, add new handlers, and so on.</p>
<p>Archivers are manged via the <codeclass="language-plaintext highlighter-rouge">archives:archivers</code> configuration block of <codeclass="language-plaintext highlighter-rouge">config.hjson</code>. Each entry in this section defines an <strong>external archiver</strong> that can be referenced in other sections of <codeclass="language-plaintext highlighter-rouge">config.hjson</code> as and in code. Entries define how to <codeclass="language-plaintext highlighter-rouge">compress</code>, <codeclass="language-plaintext highlighter-rouge">decompress</code> (a full archive), <codeclass="language-plaintext highlighter-rouge">list</code>, and <codeclass="language-plaintext highlighter-rouge">extract</code> (specific files from an archive).</p>
<p><imgclass="emoji"title=":bulb:"alt=":bulb:"src="https://github.githubassets.com/images/icons/emoji/unicode/1f4a1.png"height="20"width="20"> Generally you do not need to anything beyond installing supporting binaries. No <codeclass="language-plaintext highlighter-rouge">config.hjson</code> editing necessary; Please see <ahref="/enigma-bbs/configuration/external-binaries.html">External Binaries</a>!</p>
<p>Archiver entries in <codeclass="language-plaintext highlighter-rouge">config.hjson</code> are mostly self explanatory with the exception of <codeclass="language-plaintext highlighter-rouge">list</code> commands that require some additional information. The <codeclass="language-plaintext highlighter-rouge">args</code> member for an entry is an array of arguments to pass to <codeclass="language-plaintext highlighter-rouge">cmd</code>. Some variables are available to <codeclass="language-plaintext highlighter-rouge">args</code> that will be expanded by the system:</p>
<ul>
<li>
<codeclass="language-plaintext highlighter-rouge">{archivePath}</code> (all): Path to the archive</li>
<li>
<codeclass="language-plaintext highlighter-rouge">{fileList}</code> (compress, extract): List of file(s) to compress or extract</li>
<li>
<codeclass="language-plaintext highlighter-rouge">{extractPath}</code> (decompress, extract): Path to extract <em>to</em>
</li>
</ul>
<p>For <codeclass="language-plaintext highlighter-rouge">list</code> commands, the <codeclass="language-plaintext highlighter-rouge">entryMatch</code> key must be provided. This key should provide a regular expression that matches two sub groups: One for uncompressed file byte sizes (sub group 1) and the other for file names (sub group 2). An optional <codeclass="language-plaintext highlighter-rouge">entryGroupOrder</code> can be supplied to change the default sub group order.</p>
<p>Archive formats can be defined such that ENiGMA½ can detect them by signature or extension, then utilize the correct <em>archiver</em> to process them. Formats are defined in the <codeclass="language-plaintext highlighter-rouge">archives:formats</code> key in <codeclass="language-plaintext highlighter-rouge">config.hjson</code>. Many differnet types come pre-configured (see <codeclass="language-plaintext highlighter-rouge">core/config_default.js</code>).</p>
<h3id="example-archive-format-configuration">Example Archive Format Configuration</h3>