FirmwareKit.CPIO is a native C# archive library focused on firmware workflows.
- Read and write CPIO archives (
newc,crc,odc,binary) - Read and write TAR archives
- List archive entries with metadata summaries
- Verify archive structure and checksums
- Extract files safely with path traversal protection
- Support stream-based processing for large archives and multi-volume scenarios
- net10.0
- net8.0
- net6.0
- netstandard2.1
- Full CPIO support is available on all target frameworks.
- TAR support requires the runtime to provide
System.Formats.TarAPIs (typically .NET 7.0+). - On
net6.0andnetstandard2.1, TAR operations may throwNotSupportedExceptiondepending on runtime capabilities.
dotnet add package FirmwareKit.CPIOusing FirmwareKit.CPIO;
var archive = new CpioArchive();
var entries = archive.ReadAll(File.OpenRead("archive.cpio"));
foreach (var entry in entries)
{
Console.WriteLine(entry.Name);
}using FirmwareKit.CPIO;
using FirmwareKit.CPIO.Extraction;
var archive = new CpioArchive();
archive.ExtractToDirectory(
File.OpenRead("archive.cpio"),
"output",
new ExtractOptions
{
MakeDirectories = true,
Overwrite = true,
});using FirmwareKit.CPIO;
using FirmwareKit.CPIO.Model;
var archive = new CpioArchive();
var entries = new[]
{
new ArchiveEntry
{
Name = "hello.txt",
Data = System.Text.Encoding.UTF8.GetBytes("hello from FirmwareKit.CPIO"),
Metadata = new ArchiveEntryMetadata
{
FileType = CpioFileType.Regular,
UnixPermissions = 0x1A4,
LinkCount = 1,
},
},
};
using var output = File.Create("sample.cpio");
archive.SaveAll(output, entries, ArchiveFormat.NewAscii);- Package Id:
FirmwareKit.CPIO - License: MIT
- Symbols:
.snupkgincluded
LGPL v2.1