Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xenoatom/xenoatom.unixtools

This project provides a set of Unix tools for .NET 8+
https://github.com/xenoatom/xenoatom.unixtools

cpio dotnet unix

Last synced: about 1 month ago
JSON representation

This project provides a set of Unix tools for .NET 8+

Awesome Lists containing this project

README

        

# XenoAtom.UnixTools [![ci](https://github.com/XenoAtom/XenoAtom.UnixTools/actions/workflows/ci.yml/badge.svg)](https://github.com/XenoAtom/XenoAtom.UnixTools/actions/workflows/ci.yml) [![NuGet](https://img.shields.io/nuget/v/XenoAtom.UnixTools.svg)](https://www.nuget.org/packages/XenoAtom.UnixTools/)

This project provides a set of Unix tools for .NET 8+.

> **Note**: This project is still in early development and the API is subject to change.

## ✨ Features

- **CPIO Archive**: Read and write CPIO archives (Only the newc format is supported)
- **UnixInMemoryFileSystem**: A simple in-memory file system to manipulate files and directories
- This in memory filesystem can be used to easily manipulate in and out CPIO archives
- .NET 8.0+ compatible and NativeAOT ready

## 📖 Usage

Reading a CPIO archive:

```csharp
var cpioReader = new CpioReader(File.OpenRead("archive.cpio"));
while (cpioReader.TryGetNextEntry(out var entry))
{
Console.WriteLine($"Entry: {entry.Name} {entry.FileType} ({entry.Mode})");
})
```

Writing a CPIO archive with a `UnixInMemoryFileSystem`:

```csharp
var stream = new MemoryStream();
var fs = new UnixInMemoryFileSystem();
fs.CreateDirectory("/dir1");
fs.CreateDirectory("/dir1/dir2");
fs.CreateFile("/dir1/file1.txt", "Hello World");
{
using var writer = new CpioWriter(File.Create("archive.cpio"));
fs.WriteTo(writer);
}
```

## 🪪 License

This software is released under the [BSD-2-Clause license](https://opensource.org/licenses/BSD-2-Clause).

## 🤗 Author

Alexandre Mutel aka [xoofx](https://xoofx.github.io).