Skip to content

PragnyaKhandelwal/Zip-Wizard

Repository files navigation

ZIP WIZARD - File Handling and Compression System

Project Overview

ZipWizard is a Windows CLI tool for file operations and basic compression/decompression using an LZ77-style approach. It supports create, edit, rename, delete, search, file info, zip, and unzip operations from an interactive menu.

Reorganized Project Structure

The codebase is now physically organized for maintainability:

Zip-Wizard/
  README.md
  build.bat
  run.bat
  smoke-test.bat
  .gitignore
  include/
    *.h
  src/
    *.c
  docs/
    CP_OPTIMIZATION_ROADMAP.md

Build and Run

Open Command Prompt in repository root and run:

build.bat
run.bat

You can also run a smoke test:

smoke-test.bat

Run LZ77 roundtrip tests:

run-lz77-tests.bat

Feature Set

  • File operations: create, edit, rename, delete.
  • Search: by file name pattern or by keyword in .txt files.
  • File metadata: full path, attributes, and timestamps.
  • Compression/decompression: LZ77-based zip/unzip workflow.
  • CLI UX: menu-driven interaction with input validation.
  • Interactive menu supports arrow-key selector + Enter execution.
  • Menu layout reflows on terminal resize while waiting for selection.
  • Non-interactive CLI mode for automation.
  • Batch zip/unzip with progress and summary.
  • Telemetry summary on exit (total/success/failure/avg-time).

Non-Interactive Command Mode

zipwizard.exe --create demo.txt "hello"
zipwizard.exe --edit demo.txt "another line"
zipwizard.exe --rename demo.txt demo2.txt
zipwizard.exe --delete demo2.txt

zipwizard.exe --zip input.txt
zipwizard.exe --zip input.txt out.zwz
zipwizard.exe --unzip out.zwz
zipwizard.exe --unzip out.zwz restored.txt
zipwizard.exe --zip "C:\data\input.txt" "D:\archives\input.zwz"
zipwizard.exe --unzip "D:\archives\input.zwz" "D:\restore\input_restored.txt"

zipwizard.exe --batch-zip a.txt b.txt c.txt
zipwizard.exe --batch-unzip a.zwz b.zwz c.zwz

zipwizard.exe --search --keyword algorithm --ext txt --ignore-case
zipwizard.exe --search --keyword "*error*" --ext log --regex

zipwizard.exe --info sample.txt

CP/PBL Alignment

This project now has a dedicated optimization roadmap for Competitive Programming / PBL goals:

  • Complexity analysis baseline
  • Data structure upgrades (hash map index, inverted index)
  • Algorithm upgrades (KMP/Aho-Corasick, improved LZ77 matching)
  • Benchmark-driven optimization process

See ./docs/CP_OPTIMIZATION_ROADMAP.md for details.

Milestone 1 and 2 Status

  • Milestone 1 implemented:

    • Timing instrumentation now measures every menu operation and prints elapsed time in milliseconds.
    • Benchmark-friendly timing output is available directly in CLI.
  • Milestone 2 implemented:

    • Keyword search now uses Knuth-Morris-Pratt (KMP) matching over file streams instead of strstr per line.
    • This improves theoretical matching complexity from repeated naive checks to O(n + m) per file.

Milestone 3 Status

  • Implemented rolling-hash + hash-chain-assisted LZ77 matching in compression path.
  • Added benchmark mode to compare naive vs optimized compression:
./zipwizard.exe --benchmark-compress .\benchmark_data\large.txt
  • The benchmark prints naive time, optimized time, and computed speedup.

Milestone 4 Status

  • Added in-memory hash-map style file index cache loaded at startup.
  • CRUD flows now keep index synchronized:
    • Create adds filename to index.
    • Delete removes filename from index.
    • Rename updates old/new mapping in index.
  • Exact name search now uses index lookup (O(1) average), while wildcard search keeps filesystem scan behavior.
  • Added index benchmark mode:
./zipwizard.exe --benchmark-index large.txt 10000

Milestone 5 Status

  • Published CP/PBL-ready report:

    • ./docs/BENCHMARK_REPORT.md
  • Includes:

    • Before/after complexity table
    • Search/compression/index benchmark metrics
    • Text-based performance graphs
    • Raw benchmark outputs for reproducibility

Recommended Next Enhancements

  1. Add recursive directory search mode (--recursive).
  2. Add JSON output mode for automation (--json).
  3. Add configurable compression levels and presets.
  4. Add undo/rollback support for rename/delete via shadow log.
  5. Add performance trend report from benchmark runs.

About

ZipWizard: A CLI tool for advanced file operations and LZ77-based data compression. Built with C using dynamic memory and custom structures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors