{"id":23240634,"url":"https://github.com/signor1/rust_file_compressor","last_synced_at":"2025-04-05T22:31:16.449Z","repository":{"id":268568273,"uuid":"904773846","full_name":"Signor1/rust_file_compressor","owner":"Signor1","description":"A simple Rust CLI tool that compresses and decompresses files using the Gzip algorithm, featuring efficient file handling and execution time reporting.","archived":false,"fork":false,"pushed_at":"2024-12-17T21:01:07.000Z","size":5437,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T04:31:08.077Z","etag":null,"topics":["file-compressor","file-decompressor","flate2","gzip-algorithmn","rust-cli","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Signor1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-17T14:24:03.000Z","updated_at":"2024-12-17T21:01:11.000Z","dependencies_parsed_at":"2024-12-17T21:35:54.779Z","dependency_job_id":null,"html_url":"https://github.com/Signor1/rust_file_compressor","commit_stats":null,"previous_names":["signor1/file_compressor","signor1/rust_file_compressor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signor1%2Frust_file_compressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signor1%2Frust_file_compressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signor1%2Frust_file_compressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signor1%2Frust_file_compressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Signor1","download_url":"https://codeload.github.com/Signor1/rust_file_compressor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411236,"owners_count":20934650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-compressor","file-decompressor","flate2","gzip-algorithmn","rust-cli","rust-lang"],"created_at":"2024-12-19T05:13:20.716Z","updated_at":"2025-04-05T22:31:16.404Z","avatar_url":"https://github.com/Signor1.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Rust File Compressor and Decompressor**\n\n## **Project Description**  \nThis is a simple command-line tool written in **Rust** that allows you to compress and decompress files using the **Gzip** format. The tool is designed for efficiency, providing file size reports and execution time for each operation.  \n\n\n## **Features**\n- **File Compression**: Compress any file into Gzip format (`.gz`).\n- **File Decompression**: Decompress `.gz` files back to their original state.\n- **Performance Reporting**:  \n   - Displays file sizes before and after compression.  \n   - Shows time taken to complete the operation.  \n\n\n## **Requirements**\n- **Rust** installed on your system. (Follow [Rust installation guide](https://www.rust-lang.org/tools/install) if not already installed.)\n\n\n## **How to Clone and Set Up the Project**\n\n1. **Clone the Repository**:  \n   Use the following command to clone the project to your local machine:\n   ```bash\n   git clone https://github.com/Signor1/rust_file_compressor.git\n   cd rust_file_compressor\n   ```\n\n2. **Build the Project**:  \n   Use `cargo build` to build the project:\n   ```bash\n   cargo build --release\n   ```\n\n3. **Run the Executable**:  \n   After building, the binary can be found in the `target/release/` directory.\n\n\n## **How to Use**\n\n### **1. Compress a File**  \nRun the following command to compress a file.  \n**Usage**:  \n```bash\ncargo run --release -- compress \u003cinput_file\u003e \u003coutput_file.gz\u003e\n```\n\n**Example**:  \nTo compress the included `input.txt` file to `compressed.gz`:  \n```bash\ncargo run --release -- compress input.txt compressed.gz\n```\n\n**Output**:\n```\nOriginal size: 7143 bytes\nCompressed size: 2347 bytes\nCompression completed in 9.494892ms\n```\n\n### **2. Decompress a File**  \nRun the following command to decompress a file.  \n**Usage**:  \n```bash\ncargo run --release -- decompress \u003cinput_file.gz\u003e \u003coutput_file\u003e\n```\n\n**Example**:  \nTo decompress `compressed.gz` back to `output.txt`:  \n```bash\ncargo run --release -- decompress compressed.gz output.txt\n```\n\n**Output**:\n```\nDecompressed file size: 7143 bytes\nDecompression completed in 534.788µs\n```\n\n## **Testing the Tool**\n\n### **Included Sample File (`input.txt`)**  \nThe repository already includes a sample file named `input.txt` that you can use for testing compression and decompression:\n\n1. **Compress `input.txt`**:\n   ```bash\n   cargo run --release -- compress input.txt compressed.gz\n   ```\n\n2. **Verify Compression**:\n   Check that `compressed.gz` is created:\n   ```bash\n   ls -lh compressed.gz\n   ```\n\n3. **Decompress `compressed.gz`**:\n   ```bash\n   cargo run --release -- decompress compressed.gz output.txt\n   ```\n\n4. **Verify Decompression**:\n   Compare `input.txt` and `output.txt`:\n   ```bash\n   diff input.txt output.txt\n   ```\n\n   If there is no output, the files are identical.\n\n\n## **Error Handling**\n- Ensure the correct number of arguments are provided:\n   - **Compress**: Requires 3 arguments (`compress`, `input_file` and `output_file.gz`).\n   - **Decompress**: Requires 3 arguments (`decompress`, `input_file.gz` and `output_file`).\n\n   Example error:\n   ```\n   Usage: compress \u003csource\u003e \u003ctarget\u003e OR decompress \u003csource\u003e \u003ctarget\u003e\n   ```\n\n- The program will exit gracefully if a file does not exist or permissions are insufficient.\n\n\n## **Dependencies**\nThis project uses the following crate:\n- [flate2](https://docs.rs/flate2/latest/flate2/) - Provides Gzip compression and decompression.\n\n\n## **Contribution**  \nFeel free to fork this repository, make improvements, and submit a pull request. Suggestions and issues are welcome!\n\n\n## **License**  \nThis project is licensed under the MIT License.  \n\n\n## **Contact**  \nFor any questions or feedback, feel free to reach out:  \n- **GitHub**: [Signor1](https://github.com/signor1)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsignor1%2Frust_file_compressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsignor1%2Frust_file_compressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsignor1%2Frust_file_compressor/lists"}