damascus

Crates.iodamascus
lib.rsdamascus
version0.0.11
created_at2024-11-11 15:27:50.52546+00
updated_at2025-12-22 20:48:43.364323+00
descriptionfilesystem utility crate for the Flamberge mod manager stack
homepage
repositoryhttps://github.com/Yato202010/Damascus
max_upload_size
id1443851
size839,773
(Yato202010)

documentation

README

Damascus

GitHub Issues or Pull Requests GitHub License docs.rs Crates.io Version Crates.io MSRV Matrix

Damascus is a utility crate focused on providing a simple way to interact with filesystem from rust

Supported system

System Status Available Handle
Window Unsupported /
Linux Supported OverlayFs , FuseOverlayFs
Linux Experimental UnionFsFuse
MacOS Unsupported /

How to use?

use std::path::Path;
use damascus::{Filesystem, FuseOverlayFs, FuseOverlayFsOption, StateRecovery};
use temp_testdir::TempDir;
use std::fs::create_dir_all;

fn main() {
    let tmp = TempDir::default().to_path_buf();
    let lower1 = tmp.join("lowest_layer");
    let lower2 = tmp.join("lower_layer");
    let upper = tmp.join("upper_layer");
    let work = tmp.join("working");
    let target = tmp.join("mount_target");
    let drop = true;
    create_dir_all(&lower1).unwrap();
    create_dir_all(&lower2).unwrap();
    create_dir_all(&upper).unwrap();
    create_dir_all(&work).unwrap();
    create_dir_all(&target).unwrap();

    // handle can be created using complex or simple interface based on need
    // NOTE : drop control if once dropped the filesystem should be unmounted ie scoped mount
    let mut o = FuseOverlayFs::new(
        [&lower1, &lower2],
        Some(&upper),
        Some(&work),
        &target,
        drop,
    )
    .unwrap();
    // or
    o = FuseOverlayFs::writable([&lower1, &lower2], upper, work, &target).unwrap();
    // or
    o = FuseOverlayFs::readonly([&lower1, &lower2], &target).unwrap();

    o.add_option(FuseOverlayFsOption::CloneFd).unwrap();
    o.set_scoped(false); // true by default

    // once configured you can mount it
    o.mount().unwrap();

    // if handle is lost it can be recovered from system information
    let recovered = FuseOverlayFs::recover(target).unwrap();

    // and then unmount it
    o.unmount().unwrap();
}

FAQ

  • Will you target Windows and MacOS support?
    • In the long run some support may be implemented for those platforms as the current implementation leave place for a cross-platform support in the future.
Commit count: 81

cargo fmt