fuse3 provides OCaml bindings for libfuse 3. It lets OCaml programs
implement high-level FUSE filesystems while using Bigarray-backed buffers for
read and write callbacks.
The public Dune and opam package is fuse3. The OCaml module remains
Fuse.
- Linux
- libfuse
>= 3.10.0 pkg-config- OCaml
>= 4.08.0 - camlidl
- Dune
>= 3.7
On Debian and Ubuntu, install the FUSE development package with:
sudo apt install libfuse3-devThe recommended installation path is opam:
opam install fuse3For local development:
make
make installTo uninstall a local installation:
make uninstallBuild the library and install metadata:
makeBuild the examples:
make exampleRun the unit and compile checks:
make testRun the mounted smoke test:
make e2e-smoke-testRun the full mounted end-to-end suite:
make e2eRun the full mounted end-to-end suite in explicit single-threaded mode:
make e2e-single-threadedRun the full mounted end-to-end suite in explicit multithreaded mode:
make e2e-multithreadedThe mounted tests require Linux, /dev/fuse access, and permission to mount
FUSE filesystems. When FUSE access is unavailable, mounted e2e targets print
SKIP and exit successfully. Set OCAMLFUSE_E2E_REQUIRE_FUSE=1 to make
missing FUSE support a failure.
The examples are in example/:
hello.ml: a minimal read-only filesystem.fusexmp.ml: a passthrough-style filesystem.
After make example, the executables are under _build/default/example/.
Example:
mkdir -p /tmp/fuse3-mnt
_build/default/example/hello.exe /tmp/fuse3-mnt -f -sUnmount the filesystem from another shell when finished:
fusermount3 -u /tmp/fuse3-mntSome systems still provide the unmount command as fusermount.
New code should use the native Fuse API. The native operation record exposes
FUSE 3 concepts such as:
file_infovalues on callbacks that receive FUSE file information;file_info_updateresults fromfopenandopendir;int64file handles;- rename flags;
- readdir flags and
dir_entryvalues; - nanosecond
utimenstimestamps, includingNowandOmitsentinels.
Fuse.Fuse_compat provides the old operation record shape as an upgrade aid.
It runs on top of the FUSE 3 implementation, but it cannot represent every FUSE
3 feature. In particular, compatibility callbacks ignore new file-info
parameters, reject unsupported rename flags with EINVAL, reject timestamp
sentinels that old utime callbacks cannot represent, and convert file handles
back to int with overflow checks.
The default FUSE loop uses libfuse's multithreaded loop. In that mode, libfuse
owns worker threads and the binding registers those threads with the OCaml
runtime before invoking OCaml callbacks. Users who need single-threaded
execution can pass ~loop_mode:Single_threaded; FUSE -s also forces the
single-threaded path.
docs/bindings.md: binding architecture and maintenance notes.docs/release-notes.md: release notes for the FUSE 3 package.docs/plans/archived/fuse3/: completed FUSE 3 migration planning history.
This repository descends from the original OCamlFuse project hosted on SourceForge. It keeps the original GPL-licensed binding lineage while updating the build, package metadata, tests, and runtime integration for libfuse 3.
Original project page: https://sourceforge.net/projects/ocamlfuse/