Sha256: 20c49155ad39b8c4cfd359c0612605aa7831425a1eb96bfde81a138587da572e
Contents?: true
Size: 1.16 KB
Versions: 20
Compression:
Stored size: 1.16 KB
Contents
use crate::fs::{to_timespec, via_parent, SystemTimeSpec}; use rustix::fs::{utimensat, AtFlags, Timestamps}; use std::path::Path; use std::{fs, io}; pub(crate) fn set_times_impl( start: &fs::File, path: &Path, atime: Option<SystemTimeSpec>, mtime: Option<SystemTimeSpec>, ) -> io::Result<()> { if !super::beneath_supported() { return super::super::super::fs::set_times_manually(start, path, atime, mtime); } let times = Timestamps { last_access: to_timespec(atime)?, last_modification: to_timespec(mtime)?, }; Ok(utimensat(start, path, ×, AtFlags::RESOLVE_BENEATH)?) } pub(crate) fn set_times_nofollow_impl( start: &fs::File, path: &Path, atime: Option<SystemTimeSpec>, mtime: Option<SystemTimeSpec>, ) -> io::Result<()> { if !super::beneath_supported() { return via_parent::set_times_nofollow(start, path, atime, mtime); } let times = Timestamps { last_access: to_timespec(atime)?, last_modification: to_timespec(mtime)?, }; Ok(utimensat( start, path, ×, AtFlags::RESOLVE_BENEATH | AtFlags::SYMLINK_NOFOLLOW, )?) }
Version data entries
20 entries across 20 versions & 1 rubygems