Skip to content

Instantly share code, notes, and snippets.

@parasyte
Last active January 9, 2016 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parasyte/3591ba370f3d417a274c to your computer and use it in GitHub Desktop.
Save parasyte/3591ba370f3d417a274c to your computer and use it in GitHub Desktop.
EzFuse example.
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