fornwall / rust-script

Run Rust files and expressions as scripts without any setup or compilation step.
https://rust-script.org
Apache License 2.0
1.21k stars 41 forks source link

Make file writes concurrent-execution friendly #49

Closed MiSawa closed 2 years ago

MiSawa commented 2 years ago

This patch makes file writes use "create a temp file in the same directory, write to it, and move the it to the final location" pattern. This makes no other process trying to read Cargo.toml/metadata.json get a half-written state, so concurrent run of rust-script will be a bit safer.

fornwall commented 2 years ago

Thanks! Will be included in version 0.21.0, to be released shortly.