Bug#1103876: ITP: golang-github-natefinch-atomic -- atomic is a go package for atomic file writing
Package: wnpp
Severity: wishlist
Owner: Taavi Väänänen <taavi@debian.org>
* Package name : golang-github-natefinch-atomic
Version : 1.0.1-1
Upstream Author : Nate Finch
* URL : https://github.com/natefinch/atomic
* License : Expat
Programming Lang: Go
Description : atomic is a go package for atomic file writing
atomic is a go package for atomic file writing
.
By default, writing to a file in go (and generally any language) can
fail partway through... you then have a partially written file, which
probably was truncated when the write began, and bam, now you've lost
data.
.
This go package avoids this problem, by writing first to a temp file,
and then overwriting the target file in an atomic way. This is easy on
linux, os.Rename just is atomic. However, on Windows, os.Rename is not
atomic, and so bad things can happen. By wrapping the windows API
moveFileEx, we can ensure that the move is atomic, and we can be safe in
knowing that either the move succeeds entirely, or neither file will be
modified.
This is an indirect dependency of anubis (ITP #1102132). I plan to
maintain this under the Go team umbrella.
Reply to: