Format Comparison
Purpose
This guide compares the archive formats supported by Excavate to help you choose the right format for your needs.
Format Overview
| Format | Extension | Compression | Platform | Recursive |
|---|---|---|---|---|
CAB |
| LZSS, MSZIP, LZX, Quantum | Windows | Yes |
CPIO |
| None | Unix | Yes |
GZIP |
| Deflate | Cross-platform | Yes |
MSI |
| Embedded CAB | Windows | Yes (nested) |
RPM |
| GZIP, XZ, BZIP2 | Linux | Yes (nested) |
7-Zip |
| LZMA, LZMA2 | Cross-platform | Yes |
TAR |
| None | Unix | Yes |
XAR/PKG |
| GZIP, BZIP2 | macOS | Yes (nested) |
XZ |
| LZMA, LZMA2 | Cross-platform | Yes |
ZIP |
| Deflate, Deflate64 | Cross-platform | Yes |
Compression Comparison
| Format | Speed | Ratio | Compatibility |
|---|---|---|---|
ZIP | Fast | Good | Excellent |
TAR.GZ | Fast | Good | Excellent |
TAR.XZ | Slow | Excellent | Good |
7-Zip | Moderate | Excellent | Good |
CAB | Fast | Good | Windows |
Recursive Extraction Support
All formats support recursive extraction for nested archives:
# All formats support recursive_packages
Excavate::Archive.new('any.format').extract(recursive_packages: true)Formats commonly containing nested archives:
-
MSI → CAB
-
PKG → CPIO.GZ
-
RPM → CPIO.GZ
-
TAR.GZ → any nested archive
Feature Matrix
| Feature | ZIP | TAR.GZ | 7-Zip | MSI | PKG |
|---|---|---|---|---|---|
Pure Ruby | ✓ | ✓ | ✓ | ✓ | ✓ |
Auto-detection | ✓ | ✓ | ✓ | ✓ | ✓ |
Selective extraction | ✓ | ✓ | ✓ | ✓ | ✓ |
Filter patterns | ✓ | ✓ | ✓ | ✓ | ✓ |
Recursive extraction | ✓ | ✓ | ✓ | ✓ | ✓ |
CLI support | ✓ | ✓ | ✓ | ✓ | ✓ |