Move the detailed “Examples” documentation out of `README.md` into a
dedicated `EXAMPLES.md` to keep the README focused and easier to scan.
* Added `EXAMPLES.md` containing the full runnable examples overview:
* Notes on where examples live (`src/examples/`) and the recommended
starting point (`simple_ro_fs.cr`).
* Licensing note for sample code (MPL-2, with pointer to
`src/examples/LICENSE`).
* Sections for **Simple**, **RW**, **Passthrough**, **Tar** (with “How
to try” commands), and **Ext2** (with “How to try” commands).
* Updated `README.md` “Examples” section to a single pointer: `See
EXAMPLES.md`.
* Keeps `README.md` concise while still making example usage discoverable.
* Gives examples a stable, dedicated home where we can expand content
without bloating the README.
|
||
|---|---|---|
| scripts | ||
| spec | ||
| src | ||
| .drone.yml | ||
| .gitignore | ||
| .travis.yml | ||
| CONTRIBUTING.md | ||
| EXAMPLES.md | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| shard.yml | ||
fuse3.cr
Crystal bindings for libfuse3. This project started as a mirror of https://github.com/Papierkorb/fuse (libfuse era) and is now evolving into https://code.apps.glenux.net/glenux/fuse3.cr to track modern FUSE3 APIs.
Status
The bindings are usable for basic filesystem operations and samples, but the API surface is still being aligned with libfuse3. Expect some rough edges.
Requirements
- Crystal (use a recent compiler compatible with this repo)
- libfuse3 development and runtime packages
- Debian/Ubuntu:
libfuse3-dev - Fedora:
fuse3-devel
- Debian/Ubuntu:
Installation
Add this to your application's shard.yml:
dependencies:
fuse:
git: https://code.apps.glenux.net/glenux/fuse3.cr
Then install dependencies:
shards install
Examples
See EXAMPLES.md.
Usage
To build the examples:
make
Mount Options and Capabilities
This binding follows libfuse3 behavior. Common options and patterns:
-fruns in the foreground (recommended for debugging).-denables debug logging to stderr.-sforces single-threaded operation.-o default_permissionslets the kernel enforce POSIX permissions and skips the userspaceaccesscallback.-o allow_otherexposes the mount to other users (requiresuser_allow_otherin/etc/fuse.conf).-o fsname=NAMEsets the filesystem name shown by tools likemount.-o subtype=NAMEsets the FUSE subtype (visible in/proc/mounts).-o romounts read-only (samples that already enforce RO still accept it).
Capabilities exposed via the API depend on the filesystem implementation:
Fuse::FS::Base#accessis used unless-o default_permissionsis set.Fuse::FS::Base#readdir+#opendircan enable readdir caching viafi.cache_readdir = true.Fuse::FS::Base#opencan setfi.keep_cache = trueto avoid cache drops.
To run the simple example in the foreground (recommended for debugging):
mkdir -p ~/mnt/test
./bin/simple_ro_fs -f -d ~/mnt/test
The sample implements access. If you pass -o default_permissions, the
kernel performs permission checks and skips the userspace access callback.
To unmount (prefers fusermount3 if installed):
fusermount3 -u ~/mnt/test || fusermount -u ~/mnt/test
If the mount hangs, check it with mountpoint -q and retry unmount:
mountpoint -q ~/mnt/test && fusermount3 -u ~/mnt/test || fusermount -u ~/mnt/test
Testing
The spec suite exercises the sample binaries. The tar and ext2 integration specs require fixture files; generate them before running tests:
spec/scripts/build-tar-fixture.sh
spec/scripts/build-ext2-fixture.sh
If a fixture is missing, the corresponding spec will fail with a message reminding you to run the script.
You can also use the shell scripts under spec/scripts/ to exercise common
operations against a mounted filesystem:
spec/scripts.sh ~/mnt/test
Documentation
Generate the API documentation with:
crystal docs
The output is written under docs/.
Public API namespaces
New aliases are provided for clarity while keeping existing APIs:
Fuse::FS::Baseis the filesystem base class.Fuse::FS::Mount.run(fs)wrapsfs.run!.Fuse::Typesre-exports ABI structs/enums fromFuse::Binding.
Contributing
- Open issues or merge requests at https://code.apps.glenux.net/glenux/fuse3.cr
- Keep changes focused and include a short rationale.
- See
CONTRIBUTING.mdfor setup and workflow details.
License
MIT (see LICENSE).
Credits
- Glenn Y. Rolland (@glenux), current developer/maintainer
- Stefan Merettig (@Papierkorb), original project and early bindings