File Compression and Decompression program written in C
Uses Huffmancoding to ensure lossless compression. Capable of compressing/decompressing a single file or recursively traversing directories for all normal files.
This project was made to see how compressing would work. Changing it to write actual bits would not be that different.
./fileCompressor <flag> <path or file> |codebook|- Flags:
b: Builds the codebookc: compressesd: decompressesR: recursive mode
- Flags:
Note: the b flag must be used before the c and d flag. (You must build the codebook of the file or directory before compressing/decompressing it)
- Examples:
./fileCompressor -R -b ./will build the codebook for all files/directories in your current project../fileCompressor -b file1.txtwill build the codebook forfile1.txt./fileCompressor -R -c ./dir1 ./HuffmanCodeBookwill compress all ofdir1using the HuffmanCodeBook provided../fileCompressor -d ./dir1/file3.txt ./HuffmanCodeBookwill decompressfile3.txtusing the HuffmanCodeBook provided.