Code Monkey home page Code Monkey logo

mergearchive's Introduction

MergeArchive - A Basic Tar-Like File Format in C#

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.

Usage

Pack Files

To pack files into a MergeArchive:

dotnet run pack myarchive.mar file1.txt file2.png

Unpack Files

To unpack files from a MergeArchive:

dotnet run unpack myarchive.mar output_folder

List Contents

To list the contents of a tar-like archive:

dotnet run list myarchive.mar

Code Explanation

The code consists of a simple C# console application with two main functionalities:

  1. 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.
  2. 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.
  3. Listing Contents:

    • The ListContents method displays the names and sizes of files within the tar-like archive.

Requirements

  • .NET Core SDK

How to Run

  1. Clone this repository
git clone https://github.com/TheDomCraft/MergeArchive.git
cd MergeArchive
  1. Run the program
dotnet run pack output.mar file1.txt file2.png

or

dotnet run unpack input.mar output_folder

mergearchive's People

Stargazers

Dominik avatar

Watchers

Dominik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.