Skip to content

Commit

Permalink
Merge pull request #2014 from pali6/fix-windows-touch
Browse files Browse the repository at this point in the history
Fix touch() failing on Windows
  • Loading branch information
Kobzol authored Nov 27, 2024
2 parents 81f60e4 + 4401265 commit b43e268
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion collector/src/utils/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(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))?;

Expand Down

0 comments on commit b43e268

Please sign in to comment.