cap_primitives/rustix/fs/remove_dir_unchecked.rs
1use rustix::fs::{unlinkat, AtFlags};
2use std::path::Path;
3use std::{fs, io};
4
5/// *Unsandboxed* function similar to `remove_dir`, but which does not perform
6/// sandboxing.
7pub(crate) fn remove_dir_unchecked(start: &fs::File, path: &Path) -> io::Result<()> {
8 Ok(unlinkat(start, path, AtFlags::REMOVEDIR)?)
9}