Function sys_mount::unmount

source ·
pub fn unmount<P: AsRef<Path>>(path: P, flags: UnmountFlags) -> Result<()>
Expand description

Unmounts the device at path using the provided UnmountFlags.

This will not detach a loopback device if the mount was attached to one. This behavior may change in the future, once the loopdev crate supports querying loopback device info.

§Errors

  • If the path is not a valid C String
  • Or the unmount function fails

§Example

extern crate sys_mount;

use sys_mount::{unmount, UnmountFlags};

fn main() {
    // Unmount device at `/target/path` lazily.
    let result = unmount("/target/path", UnmountFlags::DETACH);
}