summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2020-09-01 10:24:17 +0800
committerGitHub <noreply@github.com>2020-08-31 22:24:17 -0400
commit94d38eee4cf352ca177e8ce2c7ca5d1e79f5de10 (patch)
tree4db75f58968ade5b0ad00bd679a31ef7d631e612
parentb751122e10e4c391ba8d909e96ccf7cf5e0d03a6 (diff)
replace utime crate with filetime (#7268)
-rw-r--r--Cargo.lock11
-rw-r--r--cli/Cargo.toml1
-rw-r--r--cli/ops/fs.rs8
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