Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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+
- Host: GitHub
- URL: https://github.com/xenoatom/xenoatom.unixtools
- Owner: XenoAtom
- License: bsd-2-clause
- Created: 2024-09-07T06:59:25.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T13:18:48.000Z (2 months ago)
- Last Synced: 2024-10-13T01:41:40.710Z (about 1 month ago)
- Topics: cpio, dotnet, unix
- Language: C#
- Homepage:
- Size: 181 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: license.txt
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).