mirror of
https://github.com/LeeGaoGao/ECC.git
synced 2026-07-22 02:33:06 +00:00
On Unix/macOS, rename(2) atomically replaces the destination file. The previous code ran unlinkSync before renameSync on all platforms, creating an unnecessary non-atomic window where a crash could lose data. Now the delete-before-rename is gated behind process.platform === 'win32', where rename cannot overwrite an existing file.
12 KiB
12 KiB