/// Create a new communication channel to the kernel driver by mounting the given path. The
/// kernel driver will delegate filesystem operations of the given path to the channel. When the
/// channel is dropped, the path will be unmounted.
Create a new communication channel to the kernel driver by mounting the given path. The
kernel driver will delegate filesystem operations of the given path to the channel. When the
channel is dropped, the path will be unmounted.
Create a new communication channel to the kernel driver by mounting the given path . The kernel driver will delegate filesystem operations of the given path to the channel . When the channel is dropped the path will be unmounted .
pub fn mount(mountpoint: &Path, options: &[&OsStr]) -> io::Result<Channel> {
        let mountpoint = mountpoint.canonicalize()?;
        // Convert options to `fuse_args` which requires pointers to C strings
        let args: Vec<CString> = [OsStr::new("fuse-rs")]
            .iter()
            .chain(options.iter())
            .map(|s| CString::new(s.as_bytes()).unwrap())
            .collect();
        let argptrs: Vec<_> = args.iter().map(|s| s.as_ptr()).collect();
        let fuse_args = fuse_args {
            argc: argptrs.len() as i32,
            argv: argptrs.as_ptr(),
            allocated: 0,
        };
        let path = CString::new(mountpoint.as_os_str().as_bytes())?;
        unsafe {
            let fd = try_io!(fuse_mount_compat25(path.as_ptr(), &fuse_args));
            Ok(Channel::new(fd, mountpoint))
        }
    }
pub fn mount ( mountpoint : & Path , options : & [ & OsStr ] ) -> io :: Result < Channel > { let mountpoint = mountpoint . canonicalize ( ) ? ; // Convert options to `fuse_args` which requires pointers to C strings let args : Vec < CString > = [ OsStr :: new ( " " ) ] . iter ( ) . chain ( options . iter ( ) ) . map ( | s | CString :: new ( s . as_bytes ( ) ) . unwrap ( ) ) . collect ( ) ; let argptrs : Vec < _ > = args . iter ( ) . map ( | s | s . as_ptr ( ) ) . collect ( ) ; let fuse_args = fuse_args { argc : argptrs . len ( ) as i32 , argv : argptrs . as_ptr ( ) , allocated : 0 , } ; let path = CString :: new ( mountpoint . as_os_str ( ) . as_bytes ( ) ) ? ; unsafe { let fd = try_io ! ( fuse_mount_compat25 ( path as_ptr ( ) fuse_args ) ) ; Ok ( Channel :: new ( fd , mountpoint ) ) } }
Create a new communication channel to the kernel driver by mounting the given path.
Create a new communication channel to the kernel driver by mounting the given path .
mountpoint
&Path
options
&[&OsStr]