acheronfail / repgrep

An interactive replacer for ripgrep that makes it easy to find and replace across files on the command line.
Apache License 2.0
267 stars 4 forks source link

refactor: use atomicwrites for writing replaced file #17

Closed acheronfail closed 4 years ago

acheronfail commented 4 years ago

Waiting on:

acheronfail commented 4 years ago

Investigate https://docs.rs/tempfile/3.1.0/tempfile/struct.TempPath.html#method.persist as a possible alternative

acheronfail commented 4 years ago

After some attempts I've narrowed down the issue to this: https://github.com/Stebalien/tempfile/issues/131

After running some manual tests, the atomic replacement functions correctly on Windows, just not between two instances of NamedTempFile.

acheronfail commented 4 years ago

Okay, this has been fixed with some workarounds: