mod common;
use anyhow::Result;
use froggr::modules::namespace::BindMode;
use froggr::FilesystemManager;
use froggr::NineP;
use std::path::{Path, PathBuf};
#[tokio::main]
async fn main() -> Result<()> {
let mount_point = Path::new("/tmp/mnt/ninep");
common::setup_directories(&mount_point)?;
let hello_fs = NineP::new(PathBuf::from("/tmp/target"))?;
let fs_mngr = FilesystemManager::new(hello_fs);
println!("Binding with BindMode::Before");
fs_mngr.bind(
Path::new("/tmp/source"),
Path::new("/tmp/target"),
BindMode::Before,
)?;
fs_mngr.mount(Path::new("/tmp/target"), mount_point, "remote_node_123")?;
println!("Mount complete");
Ok(())
}