alla flaggor
forky  ] [  sid  ]
[ Källkod: golang-github-natefinch-atomic  ]

Paket: golang-github-natefinch-atomic-dev (1.0.1-2)

Länkar för golang-github-natefinch-atomic-dev

Screenshot

Debianresurser:

Hämta källkodspaketet golang-github-natefinch-atomic:

Ansvariga:

Externa resurser:

Liknande paket:

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.

Hämta golang-github-natefinch-atomic-dev

Hämtningar för alla tillgängliga arkitekturer
Arkitektur Paketstorlek Installerad storlek Filer
all 4,2 kbyte21,0 kbyte [filförteckning]