RoseLeDark.BlockIO
1.0.0
dotnet add package RoseLeDark.BlockIO --version 1.0.0
NuGet\Install-Package RoseLeDark.BlockIO -Version 1.0.0
<PackageReference Include="RoseLeDark.BlockIO" Version="1.0.0" />
<PackageVersion Include="RoseLeDark.BlockIO" Version="1.0.0" />
<PackageReference Include="RoseLeDark.BlockIO" />
paket add RoseLeDark.BlockIO --version 1.0.0
#r "nuget: RoseLeDark.BlockIO, 1.0.0"
#:package RoseLeDark.BlockIO@1.0.0
#addin nuget:?package=RoseLeDark.BlockIO&version=1.0.0
#tool nuget:?package=RoseLeDark.BlockIO&version=1.0.0
BlockIO – Low-Level Disk Access for C# on Windows
BlockIO is a C# library that fills a critical gap in the Windows ecosystem: it enables direct, low-level access to physical disks and partitions — without relying on filesystem APIs or unsafe native code. Inspired by Linux tools like dd, partx, and blkid, BlockIO gives .NET developers structured, introspectable control over block devices.
🧩 Purpose
Windows lacks a clean, managed way to access raw disk sectors, GPT/MBR headers, and partition boundaries. BlockIO solves this by offering:
- Safe, stream-based access to physical disks and partitions
- GPT and MBR parsing without filesystem dependency
- Partition introspection via GUID, name, or index
- Device abstraction for RAM, files, USB, and virtual disks
- Compression-ready containers for snapshots and transfer
🔧 Core Components
📦 Devices
AbstractDevice– base class for all device typesFileDevice,RamDevice,UsbDevice,VirtualDiskDeviceCreateDeviceStream()for raw accessGetPartitionById,GetPartitionByGuid,GetPartitionByName
🧱 Partitions
AbstractPartition– holds LBA range, GUID, nameCreateStream()– returns a bounded stream over the partition- No filesystem logic — structure only
🔄 Streams
PartitionStream,DeviceStream- Access variants:
ReadOnlyPartitionStreamWritePartitionStreamRWPartitionStream- Same for device-level streams
- All implement
IBlockStreamwith:Stream CloneAsReadOnly(); Stream CloneAsWriteOnly(); Stream CloneAsReadWrite();
🧠 Utilities
HeaderUtility – GPT/MBR header parsing and validation
BlockRange, StreamTraits, DeviceDescriptor – for analysis and tooling
🚀 Example
var device = new Device("\.\\..", new GPTParser(), true);
var partition = device.GetPartitionById(0);
using var stream = partition.CreateStream(FileAccess.ReadWrite); // raw access to partition
🧠 Philosophy
BlockIO is not a filesystem library. It does not mount, interpret, or parse FAT, NTFS, ext4, or any other FS. It exposes structure, not content.
Lizenz
Dieses Projekt steht unter der European Union Public Licence v1.2 (EUPL-1.2).
Siehe LICENSES/EUPL-1.2.txt für den vollständigen Text.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- System.IO.Hashing (>= 9.0.10)
- System.Management (>= 10.0.0-rc.2.25502.107)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.