#print #single-file #archive #algorithm #process #content #regular

bin+lib anycat

Anycat is an extremely simple crate and tool that lets you unpack some single file archive and print its content to the standard output (or process it as a regular BufRead)

4 releases

Uses old Rust 2015

0.2.0 Feb 6, 2021
0.1.2 Feb 6, 2019
0.1.1 Dec 2, 2017
0.1.0 Dec 1, 2017

#446 in Compression

21 downloads per month
Used in prty

MIT license

6KB
56 lines

Anycat

Anycat is an extremely simple crate and tool that lets you unpack some single file archive and print its content to the standard output (or process it as a regular BufRead).

It supports quite a few decompression algorithms. Namely:

  • GZIP (.gz, .gzip)
  • BZIP2 (.bz2, .bzip)
  • LZMA (.xz, .lzma)
  • BROTLI (.br , .brotli)
  • ZLIB (.z , .zlib)
  • DEFLATE (.dfl)

Its indended use is to simplify the cases where you want to chose between cat, gzcat, bzcat, ... to print a file. Whenever you want to do this, you might just as well call anycat <your_file> and you should get the right result.

Tech note:

This project is written in plain Rust, so you should be able to build it w/o any trouble by simply issuing the cargo build --release command.

Changelog

  • v0.2.0: Updated the dependencies and reflected current best practices wrt error management. Now your code will not panic anymore but instead return an error you can process.

Credits

Even though I wrote anycat, the heavy lifting was done by the guys who wrote the many decompression crates for Rust and made them available on crates.io. If you are one of these guys, thank you !

Dependencies

~4MB
~65K SLoC