package renameio
import "cmd/go/internal/renameio"
Package renameio writes files atomically by renaming temporary files.
Index ¶
- func Pattern(filename string) string
- func WriteFile(filename string, data []byte) (err error)
- func WriteToFile(filename string, data io.Reader) (err error)
Functions ¶
func Pattern ¶
Pattern returns a glob pattern that matches the unrenamed temporary files created when writing to filename.
func WriteFile ¶
WriteFile is like ioutil.WriteFile, but first writes data to an arbitrary file in the same directory as filename, then renames it atomically to the final name.
That ensures that the final location, if it exists, is always a complete file.
func WriteToFile ¶
WriteToFile is a variant of WriteFile that accepts the data as an io.Reader instead of a slice.
Source Files ¶
- Version
- v1.12.1
- Published
- Mar 14, 2019
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 minute ago –
Tools for package owners.