diff --git a/collector/src/utils/fs.rs b/collector/src/utils/fs.rs index ff801d4dd..e38176df4 100644 --- a/collector/src/utils/fs.rs +++ b/collector/src/utils/fs.rs @@ -45,7 +45,7 @@ pub fn rename, Q: AsRef>(from: P, to: Q) -> anyhow::Result< /// Touch a file, resetting its modification time. pub fn touch(path: &Path) -> anyhow::Result<()> { - let file = File::options().read(true).open(path)?; + let file = File::options().read(true).write(true).open(path)?; file.set_modified(SystemTime::now()) .with_context(|| format!("touching file {:?}", path))?;