diff options
-rw-r--r-- | Cargo.lock | 11 | ||||
-rw-r--r-- | cli/Cargo.toml | 1 | ||||
-rw-r--r-- | cli/ops/fs.rs | 8 |
3 files changed, 6 insertions, 14 deletions
diff --git a/Cargo.lock b/Cargo.lock index c0fa63f14..8aa499aed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -381,7 +381,6 @@ dependencies = [ "tokio-rustls 0.14.0", "tokio-tungstenite", "url", - "utime", "uuid", "walkdir", "warp", @@ -2778,16 +2777,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" [[package]] -name = "utime" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91baa0c65eabd12fcbdac8cc35ff16159cab95cae96d0222d6d0271db6193cef" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] name = "uuid" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 7c8414e55..34b491d6a 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -68,7 +68,6 @@ termcolor = "1.1.0" tokio = { version = "0.2.22", features = ["full"] } tokio-rustls = "0.14.0" url = "2.1.1" -utime = "0.3.1" webpki = "0.21.3" webpki-roots = "0.19.0" walkdir = "2.3.1" diff --git a/cli/ops/fs.rs b/cli/ops/fs.rs index 794518e2c..9519ab0ab 100644 --- a/cli/ops/fs.rs +++ b/cli/ops/fs.rs @@ -1756,10 +1756,12 @@ fn op_utime_sync( let args: UtimeArgs = serde_json::from_value(args)?; let path = PathBuf::from(&args.path); + let atime = filetime::FileTime::from_unix_time(args.atime, 0); + let mtime = filetime::FileTime::from_unix_time(args.mtime, 0); state.check_write(&path)?; debug!("op_utime_sync {} {} {}", args.path, args.atime, args.mtime); - utime::set_file_times(args.path, args.atime, args.mtime)?; + filetime::set_file_times(path, atime, mtime)?; Ok(json!({})) } @@ -1773,12 +1775,14 @@ async fn op_utime_async( let args: UtimeArgs = serde_json::from_value(args)?; let path = PathBuf::from(&args.path); + let atime = filetime::FileTime::from_unix_time(args.atime, 0); + let mtime = filetime::FileTime::from_unix_time(args.mtime, 0); state.check_write(&path)?; tokio::task::spawn_blocking(move || { debug!("op_utime_async {} {} {}", args.path, args.atime, args.mtime); - utime::set_file_times(args.path, args.atime, args.mtime)?; + filetime::set_file_times(path, atime, mtime)?; Ok(json!({})) }) .await |