RoseLeDark.BlockIO 1.0.0

dotnet add package RoseLeDark.BlockIO --version 1.0.0
                    
NuGet\Install-Package RoseLeDark.BlockIO -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RoseLeDark.BlockIO" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RoseLeDark.BlockIO" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="RoseLeDark.BlockIO" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RoseLeDark.BlockIO --version 1.0.0
                    
#r "nuget: RoseLeDark.BlockIO, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RoseLeDark.BlockIO@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RoseLeDark.BlockIO&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=RoseLeDark.BlockIO&version=1.0.0
                    
Install as a Cake Tool

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 types
  • FileDevice, RamDevice, UsbDevice, VirtualDiskDevice
  • CreateDeviceStream() for raw access
  • GetPartitionById, GetPartitionByGuid, GetPartitionByName

🧱 Partitions

  • AbstractPartition – holds LBA range, GUID, name
  • CreateStream() – returns a bounded stream over the partition
  • No filesystem logic — structure only

🔄 Streams

  • PartitionStream, DeviceStream
  • Access variants:
    • ReadOnlyPartitionStream
    • WritePartitionStream
    • RWPartitionStream
    • Same for device-level streams
  • All implement IBlockStream with:
    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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 147 10/28/2025 1.0.0 is deprecated because it has critical bugs.
0.4.3 153 10/28/2025