cap_primitives/fs/via_parent/
set_times_nofollow.rs1use super::open_parent;
2use crate::fs::{set_times_nofollow_unchecked, MaybeOwnedFile, SystemTimeSpec};
3use std::path::Path;
4use std::{fs, io};
5
6#[inline]
7pub(crate) fn set_times_nofollow(
8 start: &fs::File,
9 path: &Path,
10 atime: Option<SystemTimeSpec>,
11 mtime: Option<SystemTimeSpec>,
12) -> io::Result<()> {
13 let start = MaybeOwnedFile::borrowed(start);
14
15 let (dir, basename) = open_parent(start, path)?;
16
17 set_times_nofollow_unchecked(&dir, basename.as_ref(), atime, mtime)
18}