Skip to content

Commit b43e268

Browse files
authored
Merge pull request #2014 from pali6/fix-windows-touch
Fix touch() failing on Windows
2 parents 81f60e4 + 4401265 commit b43e268

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collector/src/utils/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> anyhow::Result<
4545

4646
/// Touch a file, resetting its modification time.
4747
pub fn touch(path: &Path) -> anyhow::Result<()> {
48-
let file = File::options().read(true).open(path)?;
48+
let file = File::options().read(true).write(true).open(path)?;
4949
file.set_modified(SystemTime::now())
5050
.with_context(|| format!("touching file {:?}", path))?;
5151

0 commit comments

Comments
 (0)