cap_primitives/fs/via_parent/
create_dir.rs1use super::open_parent;
2use crate::fs::{create_dir_unchecked, strip_dir_suffix, DirOptions, MaybeOwnedFile};
3use std::path::Path;
4use std::{fs, io};
5
6pub(crate) fn create_dir(start: &fs::File, path: &Path, options: &DirOptions) -> io::Result<()> {
9 let start = MaybeOwnedFile::borrowed(start);
10
11 let path = strip_dir_suffix(path);
15
16 let (dir, basename) = open_parent(start, &path)?;
17
18 create_dir_unchecked(&dir, basename.as_ref(), options)
19}