7-Zip Format
Concepts
7-Zip is a high-compression archive format supporting various compression algorithms including LZMA and LZMA2. It’s commonly used for software distribution and large file compression.
7-Zip Characteristics
| Characteristic | Description |
|---|---|
File extension |
|
Compression | LZMA, LZMA2, PPMD, BCJ, BCJ2 |
Encryption | AES-256 |
Max file size | 16 billion GB (theoretical) |
Platform | Cross-platform |
Compression Methods
7-Zip supports multiple compression methods:
-
LZMA - Default, high compression ratio
-
LZMA2 - Improved LZMA with better multithreading
-
PPMD - Text compression
-
BCJ - x86 executable filter
-
BCJ2 - Enhanced x86 filter
Excavate handles all compression methods automatically.
Self-Extracting Archives
7-Zip can create self-extracting archives (.exe):
# Excavate tries 7-Zip first for .exe files
Excavate::Archive.new('sfx.exe').extract(recursive_packages: true)If the .exe is not a 7-Zip archive, Excavate falls back to CAB extraction.
Common Use Cases
CLI Usage
# Extract 7-Zip archive
excavate archive.7z
# Extract self-extracting archive
excavate installer.exe
# Recursive extraction
excavate -r package.7zTechnical Details
Excavate uses the Omnizip gem’s 7-Zip support:
-
Pure Ruby implementation
-
Supports BCJ2 filter for x86 executables
-
Handles self-extracting archives
-
No external 7-Zip binary required
Related Topics
-
CAB Format - Alternative for .exe files