Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 1.85 KB

README.md

File metadata and controls

32 lines (22 loc) · 1.85 KB

atomicf

version Coverage Status LoC license contributors contribute telegram

import "github.com/arturalbov/atomicf"

atomicf is a go package for ensure files with atomic writing by using logging. Implemented according to https://danluu.com/file-consistency/. Should prevent file corruption on any Linux filesystem.

It contains type AtomicFile struct decoration over standard os.File where func (file *AtomicFile) Write(data []bytes) (n int, err error) and func (file *AtomicFile) WriteAt(b []byte, off int64) (n int, err error) are atomic.

File could be recovered after corruption using func (file *AtomicFile) Recover() (err error) function.

Issues

If you have any problems with or questions about this package, please contact us through a GitHub issue.

Contributing

You are invited to contribute new features, fixes, or updates, large or small; I am always thrilled to receive pull requests, and do my best to process them as fast as I can.