MergeArchive is a simple C# program that implements a basic tar-like file format with a command-line interface (CLI) for packing and unpacking files. This project is intended for educational purposes and serves as a minimal example.
To pack files into a MergeArchive:
dotnet run pack myarchive.mar file1.txt file2.png
To unpack files from a MergeArchive:
dotnet run unpack myarchive.mar output_folder
To list the contents of a tar-like archive:
dotnet run list myarchive.mar
The code consists of a simple C# console application with two main functionalities:
-
Packing Files:
- The
Pack
method takes a list of file paths and creates a tar-like archive. - It uses GZip compression and stores file names along with their content sizes.
- The
-
Unpacking Files:
- The
Unpack
method extracts files from the tar-like archive to a specified output folder. - It reads the archive, recreates the files, and stores them in the output folder.
- The
-
Listing Contents:
- The ListContents method displays the names and sizes of files within the tar-like archive.
- .NET Core SDK
- Clone this repository
git clone https://github.com/TheDomCraft/MergeArchive.git
cd MergeArchive
- Run the program
dotnet run pack output.mar file1.txt file2.png
or
dotnet run unpack input.mar output_folder