TapeArchive 1.1.0
See the version list below for details.
dotnet add package TapeArchive --version 1.1.0
NuGet\Install-Package TapeArchive -Version 1.1.0
<PackageReference Include="TapeArchive" Version="1.1.0" />
paket add TapeArchive --version 1.1.0
#r "nuget: TapeArchive, 1.1.0"
// Install TapeArchive as a Cake Addin #addin nuget:?package=TapeArchive&version=1.1.0 // Install TapeArchive as a Cake Tool #tool nuget:?package=TapeArchive&version=1.1.0
TapeArchive
Usage
Before using this library you need to understand some basic of TAR structure. DO NOT SKIP THIS otherwise you won't known how to properly working with this library.
TAR is acronym for Tape Archive. It was designed for writing and reading to/from a tape drive. That mean its structure was designed for sequential access, not random access. If you want to seek to a specific file in a TAR what most library actually do is keep reading and discard all data until it reach that file. And TAR does not support compression by itself. The compression you see like file.tar.gz is just a TAR that compressed witgh GZIP later.
TAR format have a lot of variants:
- Original TAR that shipped with AT&T UNIX Version 7
- Pre-POSIX (AKA. POSIX.1-1988 draft)
- POSIX.1-1988 (AKA. ustar)
- pax (AKA. POSIX.1-2001)
- GNU
- Solaris
- AIX
- macOS
Usually most reader will be able to extract any variants. This library currently support up to ustar. But just as I said before that most reader will be able to extract any variants, including this library. So you should not have any problem when reading. For writing try to stick with original or ustar. Usually original variant will be able to suite you need in most cases.
Reading
using TapeArchive;
await using var reader = new TapeArchive(stream, true);
await foreach (var item in reader.ReadAsync())
{
// Do something with item.
}
Writing
using System;
using TapeArchive;
await using var builder = new ArchiveBuilder(stream, true);
await builder.WriteItemAsync(new(ItemType.RegularFile, new("./file1"))
{
Content = content,
Size = size,
ModificationTime = DateTime.Now,
});
// The builder must be disposed to complete the archive even if no item has been written.
Development
Prerequisites
- .NET 6 SDK
Build
dotnet build src/TapeArchive.sln
Run tests
dotnet test src/TapeArchive.sln
License
MIT
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TapeArchive:
Package | Downloads |
---|---|
CreativeCoders.IO
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.