-
-
Save parasyte/3591ba370f3d417a274c to your computer and use it in GitHub Desktop.
EzFuse example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate ezfuse; | |
use std::env; | |
use ezfuse::{EzFilesystem, File, mount}; | |
fn read_hello(_file: File, offset: u64, _size: u32) -> &'static [u8] { | |
&"Hello World!\n".as_bytes()[offset as usize..] | |
} | |
fn main() { | |
let mountpoint = env::args_os().nth(1).unwrap(); | |
mount(mountpoint, EzFilesystem::new(vec![ | |
File::new("/hello.txt").reader(read_hello), | |
])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment