Skip to content

Spike Extracting Mode

Lukas Cone edited this page Jun 28, 2024 · 2 revisions

Spike provides file extract functionality, files can be loaded and extracted in mutiple ways.

Config options create-zip and folder-per-archive are in common.extract-settings.

Cannot see diagrams below? Switch to Dark Mode.

Extract cases

Following examples are using imaginary commands, where spike_alias is alias name for Spike runner and arc_extract is imaginary exeplar module for extracting .arc files that refers to arc_extract.1.spk module shown in diagrams.

Input files, output files

Following diagram shows example, where we're providing folder with 2 archives.

Example command spike_alias arc_extract ~/archives.

Another example command that does the same thing as the one above spike_alias arc_extract ~/archives/archive0.arc ~/archives/archive1.arc

As a result, Spike will generate folder structure in ~/archives/ folder and extracts all files from .arc archives into it.

diagram

Input files, output ZIP archive

Creating ZIP archives can be set as create-zip option.

This option is turned on (true) by default.

Following diagram shows example, where we're providing folder the same way as the example above, but instead of making folder structure and extracting files to it, Spike makes zip archives right next to arc files.

diagram

Input ZIP archive, output files

Following diagrams shows examples, where we're providing ZIP file with 2 archives in it.

Example command spike_alias arc_extract ~/archives.zip

As a result, Spike will generate folder structure in ~/ folder and extracts all files from .arc archives within zip into it.

diagram

Folder per archive option

This option can be set as folder-per-archive.

With this option, Spike will make folders named after each .arc archive and extracts contents into them.

So files from archive0.arc will be extracted into ~/archive0/ folder, archive1.arc into ~/archive1/ and so on.

diagram

Input ZIP archive, output ZIP archive

Creating ZIP archives can be set as create-zip option.

This option is turned on (true) by default.

Following diagrams shows examples, where we're providing ZIP file with 2 archives in it.

Example command spike_alias arc_extract ~/archives.zip

As a result, Spike will create single zip file ~/archives_out.zip and extracts all files from .arc archives into it.

diagram

Folder per archive option

This option can be set as folder-per-archive.

With this option, Spike will make folders inside output zip named after each .arc archive and extracts contents into them.

So files from archive0.arc will be extracted into archive0/ folder, archive1.arc into archive1/ and so on. All within single zip archive.

diagram