atomicfile

package
v1.106.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: BSD-3-Clause Imports: 4 Imported by: 17 modules, 46 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package atomicfile contains code related to writing to filesystems atomically.

This package should be considered internal; its API is not stable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rename added in v1.86.0

func Rename(srcFile, dstFile string) error

Rename srcFile to dstFile, similar to os.Rename but preserving file attributes and ACLs on Windows.

func WriteFile

func WriteFile(filename string, data []byte, perm os.FileMode) (err error)

WriteFile writes data to filename+some suffix, then renames it into filename. The perm argument is ignored on Windows, but if the target filename already exists then the target file's attributes and ACLs are preserved. If the target filename already exists but is not a regular file, WriteFile returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL