Newer
Older

Jeremy Soller
committed
use std::path::Path;
use disk::Disk;
use filesystem::FileSystem;
#[cfg(not(target_os = "redox"))]

Jeremy Soller
committed
mod fuse;
#[cfg(target_os = "redox")]
mod redox;
#[cfg(target_os = "macos")]
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: &P, callback: F) -> io::Result<()> {

Jeremy Soller
committed
use std::ffi::OsStr;
fuse::mount(filesystem, mountpoint, callback, &[

Jeremy Soller
committed
// One of the uses of this redoxfs fuse wrapper is to populate a filesystem
// while building the Redox OS kernel. This means that we need to write on
// a filesystem that belongs to `root`, which in turn means that we need to
// be `root`, thus that we need to allow `root` to have access.
OsStr::new("-o"),
OsStr::new("defer_permissions"),

Jeremy Soller
committed
}
#[cfg(all(not(target_os = "macos"), not(target_os = "redox")))]
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: &P, callback: F) -> io::Result<()> {
fuse::mount(filesystem, mountpoint, callback, &[])

Jeremy Soller
committed
}
#[cfg(target_os = "redox")]
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: &P, callback: F) -> io::Result<()> {
redox::mount(filesystem, mountpoint, callback)