Sha256: 02fba1916b5acb1f72e5f052f1fa3e301ab0f5b1db513e31b083a3790b550514
Contents?: true
Size: 769 Bytes
Versions: 33
Compression:
Stored size: 769 Bytes
Contents
use super::open_parent; use crate::fs::{create_dir_unchecked, strip_dir_suffix, DirOptions, MaybeOwnedFile}; use std::path::Path; use std::{fs, io}; /// Implement `create_dir` by `open`ing up the parent component of the path and /// then calling `create_dir_unchecked` on the last component. pub(crate) fn create_dir(start: &fs::File, path: &Path, options: &DirOptions) -> io::Result<()> { let start = MaybeOwnedFile::borrowed(start); // As a special case, `create_dir` ignores a trailing slash rather than // treating it as equivalent to a trailing slash-dot, so strip any trailing // slashes. let path = strip_dir_suffix(path); let (dir, basename) = open_parent(start, &path)?; create_dir_unchecked(&dir, basename.as_ref(), options) }
Version data entries
33 entries across 33 versions & 1 rubygems