1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use std::{env, io};
pub mod fuse_system;
pub use fuse_system::{Fs};
extern crate file_node;
pub use file_node::{SingleService, ServiceDirNode};
pub fn run(svcs: Vec<Box<dyn SingleService + Send>>) {
unsafe {
let fs = fuse_system::Fs::new(svcs);
let mnt = match env::args().nth(1) {
Some(path) => path,
None => "./foo".to_string(),
};
println!("{}", mnt);
let _sys = fuse::spawn_mount(fs, &mnt, &[]).unwrap();
let mut str = String::new();
io::stdin().read_line(&mut str).expect("invalid input");
println!("all done!");
}
}
pub fn init(svc: Vec<Box<dyn SingleService + Send>>) {
let mnt = match env::args().nth(1) {
Some(path) => path,
None => "./test_dir".to_string(),
};
let fs = fuse_system::Fs::new(svc);
println!("{}", mnt);
let _sys = fuse::mount(fs, &mnt, &[]).unwrap();
let mut str = String::new();
io::stdin().read_line(&mut str).expect("invalid input");
println!("all done!");
}