Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/znippy

.nornir/compress-for-idiots.md

The compress engine — for idiots

Class: idiot. Every step, nothing assumed. Goal: compress a folder into a .znippy archive and list it, from a cold shell to a finished file. If you already know Rust and the CLI, read compress-guide.md instead — this one spells out every keystroke.

What you need first

In the terminal, type this and press Enter to go into the repo:

cd /run/media/rickard/T9/git/znippy

Step 1 — build the tool

Type this and press Enter. It compiles the znippy command-line program. The first build takes a while; that is normal.

cargo xtask build --suite ORIGINAL --atom znippy

When it finishes, the program lives at ./target/release/znippy. The --release part means "build the fast version" (without it you get a slower debug build).

Step 2 — make a folder to compress

You need something to pack. Make a small test folder with two files in it — type each line and press Enter after each:

mkdir testdir
echo "hello one" > testdir/a.txt
echo "hello two" > testdir/b.txt

Now testdir is a folder with two text files. That is what we will compress.

Step 3 — compress the folder

Type this and press Enter:

./target/release/znippy compress -i testdir -o test.znippy

What each part means:

When it finishes you will have a new file called test.znippy in the current folder. That single file holds both of your text files, compressed and indexed.

Step 4 — look inside the archive

Type this and press Enter:

./target/release/znippy list test.znippy

This prints every file stored in the archive. You should see a.txt and b.txt. If you do, it worked — the archive is real and readable.

Optional flags (only if you need them)

You do not need these for the steps above, but here is what they do if you see them:

That's it

You built the tool, made a folder, compressed it into one .znippy file, and listed its contents. To compress a real folder, repeat Step 3 with your own folder after -i and your own output name after -o.