File: file_unix.go

package info (click to toggle)
golang-github-natefinch-atomic 1.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 88 kB
  • sloc: makefile: 2
file content (14 lines) | stat: -rw-r--r-- 329 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// +build !windows

package atomic

import (
	"os"
)

// ReplaceFile atomically replaces the destination file or directory with the
// source.  It is guaranteed to either replace the target file entirely, or not
// change either file.
func ReplaceFile(source, destination string) error {
	return os.Rename(source, destination)
}