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