Atomic file writes
- 主要言語
- Go
- スター
- 16
- フォーク
- 4
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
### TL;DR
The `copyRecursive()` function currently writes output files by doing open, write, then close. @sethvargo suggested it would be cleaner to do an atomic write, and he referenced https://github.com/hashicorp/consul-template/blob/e97a929318455f1ff0d11360a746412d633a004c/renderer/renderer.go#L117-L214 as an example.
The benefit is that there's no possibility of an individual file being partially written to the output directory, in case the process terminates abruptly. IIUC there would still be a possibility of a partial success though, where some files were written (atomically) but other files were not, before termination.
I'm not currently convinced that this adds value that justifies the performance cost and implementation cost, but I'm open to being convinced.
### Detailed design
_No response_
### Alternatives considered
_No response_
### Additional information
_No response_
コントリビューションガイド
評価
この issue はまだ評価されていません。