Dhara.Storage
0.10.1
dotnet add package Dhara.Storage --version 0.10.1
NuGet\Install-Package Dhara.Storage -Version 0.10.1
<PackageReference Include="Dhara.Storage" Version="0.10.1" />
<PackageVersion Include="Dhara.Storage" Version="0.10.1" />
<PackageReference Include="Dhara.Storage" />
paket add Dhara.Storage --version 0.10.1
#r "nuget: Dhara.Storage, 0.10.1"
#:package Dhara.Storage@0.10.1
#addin nuget:?package=Dhara.Storage&version=0.10.1
#tool nuget:?package=Dhara.Storage&version=0.10.1
Dhara.Storage
.NET API for file and directory handles, content-based analysis, I/O with progress and cancellation, and directory watching—usable from ordinary libraries and desktop apps on Windows, Linux, and macOS.
The package bundles a small native dhara-sd sidecar for supported runtimes and talks to it over a local gRPC connection, so storage and analysis run at native speed alongside your .NET process. You work in C#; you do not need to write Rust, and the sidecar starts automatically on first use.
Why use it
DharaStorage.File/DharaStorage.Directoryfor path-based work- Content-based MIME and type candidates (
Analyze/AnalyzePath);Metadataenriched from the handle cache - Sync and async read, write, copy, move, rename, delete
- Process-first copy/move (
StorageProcess) withIProgress<StorageProcessEvent> - Directory watching with typed change events
- One NuGet with a bundled
dhara-sdsidecar for supported RIDs - Native AOT–compatible: publish your app with
<PublishAot>true</PublishAot>; the sidecar is deployed alongside your executable via NuGet native assets
Prerequisites
- .NET SDK 10.0.x
- A supported runtime identifier at execution time (see below)
Install
dotnet add package Dhara.Storage --version 0.10.1
| OS | RIDs | Runtime status |
|---|---|---|
| Windows | win-x64, win-arm64 |
Named pipe + handle-dup |
| Linux | linux-x64, linux-arm64 |
UDS + SCM_RIGHTS FD pass |
| macOS | osx-arm64 |
UDS + SCM_RIGHTS FD pass |
Usage
1. Open a file, analyze, and read
using Dhara.Storage;
var file = DharaStorage.File(@"C:\data\sample.pdf");
var report = file.Analyze();
var metadata = file.Metadata; // enriched from the cached analysis
var bytes = await file.ReadBytesAsync();
2. Watch a directory
using Dhara.Storage;
var directory = DharaStorage.Directory(@"C:\data");
directory.StartWatching();
directory.Changed += (_, change) => Console.WriteLine(change.Path);
3. Copy (process-first)
using Dhara.Storage;
using Dhara.Storage.Models.Progress;
var file = DharaStorage.File(@"C:\data\input.bin");
var progress = new Progress<StorageProcessEvent>(e =>
{
if (e is StorageProcessBytes bytes)
Console.WriteLine($"{bytes.BytesTransferred} bytes");
});
// Sync: starts immediately and waits inside.
file.Copy(@"C:\data\copy.bin", progress, overwrite: true);
// Async: starts immediately; await StorageProcess for the destination path.
var destination = await file.CopyAsync(@"C:\data\copy2.bin", progress, overwrite: true);
4. Host lifetime (ASP.NET Core, worker services)
Add Dhara.Storage.Extensions.Hosting to start and stop the sidecar with your application's IHost:
builder.Services.AddDharaStorage();
Shell icons are available over the sidecar when requested (includeIcon). File type labels come from content analysis when requested.
Related
- Product overview: Dhara Storage
- Generic Host integration: Dhara.Storage.Extensions.Hosting
License
Apache-2.0.
| 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
- Google.Protobuf (>= 3.35.1)
- Grpc.Net.Client (>= 2.83.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Dhara.Storage:
| Package | Downloads |
|---|---|
|
Dhara.Storage.Extensions.Hosting
Generic Host integration that starts and stops the Dhara Storage sidecar daemon with the application lifetime. |
GitHub repositories
This package is not used by any popular GitHub repositories.