abcxyz / abcxyz/abc

Atomic file writes

オープン
#25 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement priority_low
主要言語
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。