combinatory FUSE library + cmdfs implementation
- Rust 99.2%
- Nix 0.8%
| src | ||
| transfuse-bin | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
transfuse
transfuse is a Rust library for combining virtual filesystems in useful ways.
For example, to mirror the contents of images, but only its png files, and
serve them under /mnt using FUSE:
use transfuse::mix::{filter_files, mirror};
use transfuse::mount::mount;
use transfuse::server::serve;
#[tokio::main]
async fn main() -> io::Result<()> {
let images = mirror("images");
let png_only = filter_files(extension("png"), images);
let mount = mount("/mnt").await?;
serve(mount.fuse_fd, png_only).await?
}
The FUSE implementation is original and does not depend on libfuse.
transfuse also provides a binary for dynamically transforming the contents of a directory, similar to cmdfs:
tf --to opus --from flac ~/mnt ~/Music -- opusenc --bitrate 128 --music - -
The command passed after -- will have source files with the matching extension
piped to its stdin, and its stdout will be piped to any reader of the resulting
file. Transcoded files will appear to have a size of 0, and will be non-seekable
when opened.
Please tell me how to get this computer program as soon as possible
If you're cool: nix shell git+https://git.maulne.net/maulne/transfuse.
or just clone and cargo build --release of course.