Damascus
Filesystem utility crate in rust (WIP)
Install / Use
/learn @Yato202010/DamascusREADME
Damascus
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.
Related Skills
himalaya
352.2kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
taskflow
352.2kname: taskflow description: Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layer
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
