summaryrefslogtreecommitdiff
path: root/cli/ops/fs.rs
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 /cli/ops/fs.rs
parentb751122e10e4c391ba8d909e96ccf7cf5e0d03a6 (diff)
replace utime crate with filetime (#7268)
Diffstat (limited to 'cli/ops/fs.rs')
-rw-r--r--cli/ops/fs.rs8
1 files changed, 6 insertions, 2 deletions
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