Allow actual modification of mtime
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
use std::{env, fs};
|
||||
#[allow(unused_imports)]
|
||||
use std::fs::File;
|
||||
use std::path::PathBuf;
|
||||
use std::process::exit;
|
||||
@@ -36,8 +35,8 @@ fn set_mtime(path: &PathBuf, mtime: SystemTime) -> std::io::Result<()> {
|
||||
let datetime: DateTime<Local> = mtime.into();
|
||||
|
||||
if mtime < last_modified {
|
||||
// let dest = File::open(path)?;
|
||||
// dest.set_modified(mtime)?;
|
||||
let dest = File::open(path)?;
|
||||
dest.set_modified(mtime)?;
|
||||
println!("SET {} - {:?}", datetime.format("%Y-%m-%d %H:%M:%S"), &path);
|
||||
} else {
|
||||
println!(" NO {} - {:?}", datetime.format("%Y-%m-%d %H:%M:%S"), &path);
|
||||
|
||||
Reference in New Issue
Block a user