This Rust program compresses a specified file using gzip compression and writes the compressed data to a target file. It provides information about the size of the source and target files and the time taken for the compression process.
- Rust (latest stable version recommended)
flate2
crate
- Install Rust by following the instructions at rust-lang.org.
- Add the
flate2
crate to yourCargo.toml
:[dependencies] flate2 = "1.0.24"
- Clone this repository or download the source code.
- Navigate to the project directory.
- Build the project:
cargo build --release
- Run the program with the source and target file paths as arguments:
cargo run --release source_file target_file
cargo run --release input.txt output.gz