{"id":52221,"library":"facebookgo-atomicfile","title":"Facebook Go Atomic File","description":"Package atomicfile provides the ability to write a file with an eventual rename on Close (using os.Rename), allowing for a file to always be in a consistent state and never represent an in-progress write.","status":"active","version":"0.0.0-20151019160806-2de1f203e7d5","language":"go","source_language":null,"source_url":"https://github.com/facebookgo/atomicfile","tags":["atomic","file","write","rename","consistency"],"install":[{"cmd":"go get github.com/facebookgo/atomicfile","lang":"bash","label":"Install github.com/facebookgo/atomicfile"}],"dependencies":[],"imports":[{"symbol":"atomicfile","correct":"github.com/facebookgo/atomicfile"}],"quickstart":{"code":"package main\n\nimport (\n\t\"log\"\n\t\"github.com/facebookgo/atomicfile\"\n)\n\nfunc main() {\n\tf, err := atomicfile.New(\"example.txt\", 0644)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer f.Close()\n\tf.Write([]byte(\"Hello, world!\"))\n}","lang":"go","description":"Creates an atomic file and writes data to it."},"warnings":[{"fix":"Ensure the target filesystem supports atomic renames (e.g., local POSIX filesystems).","message":"os.Rename may not be atomic on all operating systems","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'abil':9 'allow':22 'alway':27 'atom':3,41 'atomicfil':6 'close':19 'consist':31,45 'eventu':16 'facebook':1 'file':4,13,25,42 'go':2 'in-progress':37 'never':34 'os.rename':21 'packag':5 'progress':39 'provid':7 'renam':17,44 'repres':35 'state':32 'use':20 'write':11,40,43","created_at":"2026-06-15T06:45:59.233474+00:00","updated_at":"2026-06-15T06:45:59.233474+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/facebookgo/atomicfile","github":"https://github.com/facebookgo/atomicfile","docs":"https://pkg.go.dev/github.com/facebookgo/atomicfile#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}