软件包:golang-github-natefinch-atomic-dev(1.0.1-2)
golang-github-natefinch-atomic-dev 的相关链接
Debian 的资源:
下载源码包 golang-github-natefinch-atomic:
- [golang-github-natefinch-atomic_1.0.1-2.dsc]
- [golang-github-natefinch-atomic_1.0.1.orig.tar.gz]
- [golang-github-natefinch-atomic_1.0.1-2.debian.tar.xz]
维护小组:
外部的资源:
- 主页 [github.com]
相似软件包:
- libghc-atomic-write-dev
- libghc-atomic-write-doc
- libghc-atomic-write-prof
- golang-github-hashicorp-errwrap-dev
- golang-github-mitchellh-mapstructure-dev
- golang-github-go-viper-mapstructure-dev
- golang-github-michaeltjones-walk-dev
- libschedule-ratelimiter-perl
- golang-github-hashicorp-go-cleanhttp-dev
- golang-github-invopop-jsonschema-dev
- libdancer2-plugin-database-perl
Go package for atomic file writing (library)
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.