Don't preserve access time
This commit is contained in:
parent
7a3de278f8
commit
79743a3b48
2 changed files with 2 additions and 11 deletions
|
|
@ -689,10 +689,9 @@ fn copy_times(_: &Metadata, _: &Path) -> PngResult<()> {
|
|||
|
||||
#[cfg(feature = "filetime")]
|
||||
fn copy_times(input_path_meta: &Metadata, out_path: &Path) -> PngResult<()> {
|
||||
let atime = filetime::FileTime::from_last_access_time(input_path_meta);
|
||||
let mtime = filetime::FileTime::from_last_modification_time(input_path_meta);
|
||||
trace!("attempting to set file times: atime: {atime:?}, mtime: {mtime:?}");
|
||||
filetime::set_file_times(out_path, atime, mtime).map_err(|err_io| {
|
||||
trace!("attempting to set file modification time: {mtime:?}");
|
||||
filetime::set_file_mtime(out_path, mtime).map_err(|err_io| {
|
||||
PngError::new(&format!(
|
||||
"unable to set file times on {out_path:?}: {err_io}"
|
||||
))
|
||||
|
|
|
|||
|
|
@ -437,8 +437,6 @@ fn preserve_attrs() {
|
|||
.metadata()
|
||||
.expect("unable to get file metadata for output file");
|
||||
#[cfg(feature = "filetime")]
|
||||
let atime_canon = filetime::FileTime::from_last_access_time(&meta_input);
|
||||
#[cfg(feature = "filetime")]
|
||||
let mtime_canon = filetime::FileTime::from_last_modification_time(&meta_input);
|
||||
|
||||
let (mut output, opts) = get_opts(&input);
|
||||
|
|
@ -458,12 +456,6 @@ fn preserve_attrs() {
|
|||
.metadata()
|
||||
.expect("unable to get file metadata for output file");
|
||||
#[cfg(feature = "filetime")]
|
||||
assert_eq!(
|
||||
&atime_canon,
|
||||
&filetime::FileTime::from_last_access_time(&meta_output),
|
||||
"expected access time to be identical to that of input",
|
||||
);
|
||||
#[cfg(feature = "filetime")]
|
||||
assert_eq!(
|
||||
&mtime_canon,
|
||||
&filetime::FileTime::from_last_modification_time(&meta_output),
|
||||
|
|
|
|||
Loading…
Reference in a new issue