LTRData.FuseDotNet
2.0.0
dotnet add package LTRData.FuseDotNet --version 2.0.0
NuGet\Install-Package LTRData.FuseDotNet -Version 2.0.0
<PackageReference Include="LTRData.FuseDotNet" Version="2.0.0" />
<PackageVersion Include="LTRData.FuseDotNet" Version="2.0.0" />
<PackageReference Include="LTRData.FuseDotNet" />
paket add LTRData.FuseDotNet --version 2.0.0
#r "nuget: LTRData.FuseDotNet, 2.0.0"
#:package LTRData.FuseDotNet@2.0.0
#addin nuget:?package=LTRData.FuseDotNet&version=2.0.0
#tool nuget:?package=LTRData.FuseDotNet&version=2.0.0
FuseDotNet
.NET wrapper for FUSE 3 for implementing file systems in user space on Linux and FreeBSD.
FuseDotNet focuses on reducing garbage collection and heap allocation pressure. Its callbacks expose native-memory views of path names and I/O buffers instead of automatically allocating strings and byte arrays for every request.
Package and repository contents
Install the LTRData.FuseDotNet NuGet package:
dotnet add package LTRData.FuseDotNet
The C# namespace is FuseDotNet.
| Project | Purpose |
|---|---|
| FuseDotNet | Library, callback interface, mount/unmount helpers and service lifecycle. |
| MirrorFs | Sample that exposes an existing directory through FUSE. It can modify the underlying files; several operations are unimplemented. |
| TempFs | Minimal callback demonstration exposing test.txt with fixed content. Writes are acknowledged but not stored. |
For DiscUtils file systems, use the separate LTRData.DiscUtils.MountFuse adapter.
Frameworks and native requirements
The library targets net10.0, net9.0, net8.0, netstandard2.1, netstandard2.0 and net48. The .NET Standard and .NET Framework builds provide compatibility options for older runtimes, including Mono.
The current native platform mappings are:
| Operating system | Architectures | Notes |
|---|---|---|
| Linux | x86, x64, ARM32, ARM64 | Requires a compatible runtime and native FUSE 3 installation. |
| FreeBSD | x64 | Use a net8.0, net9.0 or net10.0 build; FreeBSD stat marshalling and unmount handling are excluded from the .NET Standard and .NET Framework builds. |
Install FUSE 3 separately and ensure the native library can be resolved as fuse3. The host also needs kernel FUSE support and appropriate device and mount-point permissions. Framework compatibility alone does not add Windows or macOS support.
Mount privileges depend on the host configuration. On Linux, libfuse's fusermount3 helper can allow ordinary users to mount their own file systems.
Implementing a file system
Implement IFuseOperations, then call the Mount extension method. Path arguments contain UTF-8 bytes; FuseHelper.GetString can decode them when needed. Native-memory arguments refer to callback-owned buffers and must not be retained after the callback returns.
Given an existing IFuseOperations operations instance:
using FuseDotNet;
operations.Mount(new[] { "MyFileSystem", "-f", "-s", "/path/to/mountpoint" });
Arguments follow the native FUSE command line, including a program name as the first argument. -f keeps FUSE in the foreground and the call blocks until unmounted; -d also enables native debug output. Without foreground mode, native FUSE may daemonize by forking the process. Use foreground mode when hosting FUSE in a managed application. -s selects single-threaded request handling; omit it only when the implementation handles concurrent callbacks.
Keep the operations object and its backing resources alive until the mount call returns after unmounting. Callbacks return PosixResult values; the wrapper translates these to native FUSE results. The wrapper does not expose every FUSE 3 operation: extended attributes, file locking and several other callbacks are currently left unset in Fuse.Mount.
Rename flags and initialization configuration
Filesystems can optionally implement IFuseRenameWithFlags and/or IFuseInitWithConfig in addition to IFuseOperations. The proxy calls the optional method instead of the corresponding legacy method, including for an ordinary rename with no flags. Without IFuseRenameWithFlags, a rename with nonzero flags returns EINVAL without calling the legacy implementation. Unknown flags and the invalid combination of NoReplace | Exchange also return EINVAL.
NoReplace must preserve an existing destination and Exchange must atomically swap two existing entries. A filesystem must return an error if it cannot implement the requested semantics. IFuseInitWithConfig.Init receives libfuse's initialized configuration by reference; modify only the required fields and do not retain the reference. FuseConfig exposes the stable prefix through auto_cache, leaving later, version-dependent fields untouched. Enabling hard_remove opts out of libfuse's hidden-file handling and requires the filesystem to support open-but-unlinked files; it is not enabled by the wrapper.
Service lifecycle and unmounting
FuseService hosts an operations instance on a long-running task. Pass foreground arguments with the mount point last.
Start()launches the task; it does not wait for the mount to become ready.WaitForExit()andWaitForExitAsync()wait for completion. Their timeout overloads return whether the task finished; a timeout does not request unmounting.- Subscribe to
Errorfor failures from the service procedure andStoppedfor a normal return from the mount call. The service disposes its operations object. Dispose()requests unmounting when it detects an active FUSE mount and waits for the task to stop. It can block if unmounting fails.
Fuse.Unmount(path) throws PosixException on a native unmount error. Fuse.TryUnmount(path, out result) returns a Boolean and the native error result. These call the OS unmount API directly, so their permissions can differ from those of a mount helper.
To unmount from another terminal on Linux using the FUSE helper:
fusermount3 -u /path/to/mountpoint
On FreeBSD, or where the caller has the required OS privileges:
umount /path/to/mountpoint
Building and running samples
Use the .NET 10 SDK for the current source tree. For a single-target library build:
dotnet build FuseDotNet/FuseDotNet.csproj -c Debug -f net10.0
The library's Release configuration also generates a NuGet package. A full build targets all configured frameworks.
The samples currently target net8.0 and net9.0, as well as netstandard2.1; choose a runnable .NET target with a matching installed runtime. From the repository root, with an existing empty mount directory:
dotnet run --project TempFs/TempFs.csproj -f net8.0 -- -f -s /path/to/mountpoint
For the mirror sample, supply the source directory before the FUSE options and use a separate mount directory:
dotnet run --project MirrorFs/MirrorFs.csproj -f net8.0 -- /path/to/source -f -s /path/to/mountpoint
These are illustrative implementations with incomplete file-system semantics; review their callbacks before adapting them.
License
FuseDotNet is distributed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. net11.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- LTRData.Extensions.Native (>= 1.0.24)
- Microsoft.Bcl.HashCode (>= 6.0.0)
- System.Collections.Immutable (>= 11.0.0)
- System.Memory (>= 4.6.3)
-
.NETStandard 2.0
- LTRData.Extensions.Native (>= 1.0.24)
- Microsoft.Bcl.HashCode (>= 6.0.0)
- System.Collections.Immutable (>= 11.0.0)
- System.Memory (>= 4.6.3)
-
.NETStandard 2.1
- LTRData.Extensions.Native (>= 1.0.24)
- Microsoft.Bcl.HashCode (>= 6.0.0)
- System.Collections.Immutable (>= 11.0.0)
-
net10.0
- LTRData.Extensions.Native (>= 1.0.24)
- Microsoft.Bcl.HashCode (>= 6.0.0)
- System.Collections.Immutable (>= 11.0.0)
-
net11.0
- LTRData.Extensions.Native (>= 1.0.24)
- Microsoft.Bcl.HashCode (>= 6.0.0)
-
net8.0
- LTRData.Extensions.Native (>= 1.0.24)
- Microsoft.Bcl.HashCode (>= 6.0.0)
- System.Collections.Immutable (>= 11.0.0)
-
net9.0
- LTRData.Extensions.Native (>= 1.0.24)
- Microsoft.Bcl.HashCode (>= 6.0.0)
- System.Collections.Immutable (>= 11.0.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on LTRData.FuseDotNet:
| Package | Downloads |
|---|---|
|
LTRData.DiscUtils.MountFuse
FUSE integration for exposing DiscUtils filesystem implementations on platforms supported by LTRData.FuseDotNet. |
|
|
LTRData.DiscUtils.Fuse
Package Description |
|
|
LimitingFactor.LowLevel
Resource-safe Linux namespace, FUSE approval, and OverlayFS process-sandbox mechanisms. |
|
|
Devedse.DiscUtils.MountFuse
FUSE integration for exposing DiscUtils filesystem implementations on platforms supported by LTRData.FuseDotNet. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 46 | 11/14/2026 |
| 1.0.0.14 | 12,330 | 11/25/2025 |
| 1.0.0.13 | 256 | 11/23/2025 |
| 1.0.0.12 | 372 | 11/16/2025 |
| 1.0.0.11 | 781 | 10/1/2025 |
| 1.0.0.10 | 446 | 7/4/2025 |
| 1.0.0.9 | 291 | 7/1/2025 |
| 1.0.0.8 | 616 | 5/16/2025 |
| 1.0.0.7 | 419 | 3/2/2025 |
| 1.0.0.6 | 359 | 2/6/2025 |
| 1.0.0.2 | 722 | 8/16/2023 |
| 1.0.0.1 | 482 | 8/14/2023 |
| 1.0.0 | 459 | 8/13/2023 |