cap_primitives/rustix/fs/
remove_file_unchecked.rs

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