cap-primitives 0.16.1

Capability-based primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::fs::DirOptions;
use posish::fs::{mkdirat, Mode, RawMode};
use std::{fs, io, path::Path};

/// *Unsandboxed* function similar to `create_dir`, but which does not perform
/// sandboxing.
pub(crate) fn create_dir_unchecked(
    start: &fs::File,
    path: &Path,
    options: &DirOptions,
) -> io::Result<()> {
    Ok(mkdirat(
        start,
        path,
        Mode::from_bits(options.ext.mode as RawMode).unwrap(),
    )?)
}