This library is being created as part of a laboratory work on the subject "Fundamentals of information theory and coding". It allows you to archive files and folders using compression.
The Archiver5E2D library contains a static Archiver class with Archive and Dearchive methods. Let's take a step-by-step look at how to archive and unarchive a file and folder.
Use the Archive method to archive a file or folder by passing the appropriate paths, and then use the Create method to save the archive to the desired path. If desired path to create does not exist, it will be created.
File
const string filePath = @"C:\PATH\FILE_NAME.FORMAT";
const string saveFilePath = @"C:\SAVE_PATH\FOLDER_NAME";
var archivedFile = Archiver.Archive(filePath);
archivedFile.Create(saveFilePath);
Folder
const string folderPath = @"C:\PATH\FOLDER_NAME";
const string saveFolderPath = @"C:\SAVE_PATH\FOLDER_NAME";
var archivedFolder = Archiver.Archive(folderPath);
archivedFolder.Create(saveFolderPath);
Use the archive method to unzip the file or folder, bypassing the appropriate paths, and then use the Creation method for all dearchived objects to save them to the desired folder.
File
var unarchivedFile = Archiver.Dearchive(Path.Combine(saveFilePath, archivedFile.Name));
foreach (var entity in unarchivedFile)
entity.Create(saveFilePath);
Folder
var unarchivedFolder = Archiver.Dearchive(Path.Combine(saveFolderPath, archivedFolder.Name));
foreach (var entity in unarchivedFolder)
entity.Create(saveFolderPath);
- Add files archiving/unarchiving
- Add folders archiving/unarchiving
- Add subfolders archiving/unarchiving
- Add compression algorithms
Distributed under the MIT License. See LICENSE.txt
for more information.
Your Name - Dmitrii - [email protected]
Project Link: https://github.com/Dikin01/Archiver5E2D