/// Returns whether the `Path` is a Btrfs subvolume.
Returns whether the `Path` is a Btrfs subvolume.
Returns whether the ` Path ` is a Btrfs subvolume .
pub fn is_subvolume<P: AsRef<Path>>(path: P) -> Result<bool, Error> {
    let cpath = CString::new(path.as_ref().as_os_str().as_bytes()).unwrap();
    let errcode = unsafe { ffi::btrfs_util_is_subvolume(cpath.as_ptr()) };
    match errcode {
        ffi::btrfs_util_error_BTRFS_UTIL_OK => Ok(true),
        ffi::btrfs_util_error_BTRFS_UTIL_ERROR_NOT_SUBVOLUME
        | ffi::btrfs_util_error_BTRFS_UTIL_ERROR_NOT_BTRFS => Ok(false),
        _ => Err(errcode.into()),
    }
}
pub fn is_subvolume < P : AsRef < Path > > ( path : P ) -> Result < bool , Error > { let cpath = CString :: new ( path . as_ref ( ) . as_os_str ( ) . as_bytes ( ) ) . unwrap ( ) ; let errcode = unsafe { ffi :: btrfs_util_is_subvolume ( cpath . as_ptr ( ) ) } ; match errcode { ffi :: btrfs_util_error_BTRFS_UTIL_OK => Ok ( true ) , ffi :: btrfs_util_error_BTRFS_UTIL_ERROR_NOT_SUBVOLUME | ffi :: btrfs_util_error_BTRFS_UTIL_ERROR_NOT_BTRFS => Ok ( false ) , _ => Err ( errcode . into ( ) ) , } }
Returns whether the `Path` is a Btrfs subvolume.
Returns whether the ` Path ` is a Btrfs subvolume .
path
P