LibFuseSharp 1.0.1
dotnet add package LibFuseSharp --version 1.0.1
NuGet\Install-Package LibFuseSharp -Version 1.0.1
<PackageReference Include="LibFuseSharp" Version="1.0.1" />
<PackageVersion Include="LibFuseSharp" Version="1.0.1" />
<PackageReference Include="LibFuseSharp" />
paket add LibFuseSharp --version 1.0.1
#r "nuget: LibFuseSharp, 1.0.1"
#:package LibFuseSharp@1.0.1
#addin nuget:?package=LibFuseSharp&version=1.0.1
#tool nuget:?package=LibFuseSharp&version=1.0.1
LibFuseSharp
A FUSE 3 high-level mount library for .NET on Linux (libfuse3) and macOS (macFUSE). Implement a read-only volume, mount it with one call, and probe the runtime before you mount.
Source: purelogiccode/LibFuseSharp. Used by SimpleXisoDrive and CHDMounter.
Requirements
- Linux (x64 or ARM64) with libfuse3 (for example
sudo apt install libfuse3-3 fuse3) and/dev/fuseavailable, or macOS (Intel or Apple silicon) with macFUSE installed. - .NET 8, 9 or 10 runtime.
Set the LIBFUSESHARP_LIBRARY environment variable to override the FUSE library path
used for probing and loading (mainly useful for tests and custom installations). The legacy
SIMPLEXISODRIVE_FUSE_LIBRARY name is still honored as a fallback.
Quick start
Implement IFuseVolume for your data source:
using FuseSharp;
public sealed class MyVolume : IFuseVolume
{
public string VolumeLabel => "MyVolume";
public DateTime VolumeCreationTime => DateTime.UtcNow;
public ulong VolumeSize => 1024 * 1024;
public IFuseEntry? GetEntry(string path) { /* look up "/file.txt", "/" ... */ }
public IEnumerable<IFuseEntry> GetFolderList(string path) { /* list "/" ... */ }
public int ReadFile(IFuseEntry entry, Span<byte> buffer, long offset) { /* fill buffer ... */ }
}
Check the runtime, then mount (blocks until unmounted):
if (!FuseAvailability.Check(out var library))
return; // installation guidance was already printed to stderr
var fs = new FuseFileSystem(new MyVolume());
var exitCode = fs.Run("/mnt/myvolume", debug: false, onMounted: () => Console.WriteLine("Mounted"));
FuseFileSystem.Run drives the FUSE session manually and shuts it down cleanly on Ctrl+C,
SIGTERM or SIGHUP. Call fs.Exit() from any thread to request a shutdown (for example
when your application closes). External unmounts (umount, fusermount3 -u, Finder eject) close
the FUSE device; fuse_loop then returns -ENODEV, which is treated as a normal end of the
session once init ran, so Run returns 0.
To check only whether mounting is possible — without printing installation guidance — use:
if (FuseAvailability.Check(out _, candidates: null, printInstructions: false))
Console.WriteLine("FUSE is available.");
API overview
| Type | Description |
|---|---|
IFuseVolume |
Read-only volume: label, size, entry lookup, directory listing and file reads. Paths are POSIX-style (/ is the root). |
IFuseEntry |
A single file or directory: name, IsDirectory and Size. |
FuseFileSystem |
Serves a volume through the FUSE 3 high-level API (read-only). Run(mountPoint, debug, onMounted) blocks until unmount; Exit() requests a clean shutdown. |
FuseAvailability |
Check(out libraryPath) probes libfuse3/macFUSE and /dev/fuse and prints installation guidance when missing. |
The volume is exposed read-only: open rejects write access, macOS setattr returns EROFS,
and unimplemented operations fail with ENOSYS.
License
MIT — see LICENSE.txt. Lead Developer: Peterson Fernandes (PureLogicCode.com).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.