mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-24 15:49:06 +02:00
* Use POSIX-like file read/write of json for windows + tests: allow renaming an open file.
17 lines
397 B
Go
17 lines
397 B
Go
//go:build !windows
|
|
|
|
package util
|
|
|
|
import "os"
|
|
|
|
// openRead opens path for reading. Only Windows needs more than this: there a
|
|
// plain open holds the file against the rename that replaces it.
|
|
func openRead(path string) (*os.File, error) {
|
|
return os.Open(path)
|
|
}
|
|
|
|
// renameFile replaces newpath with oldpath.
|
|
func renameFile(oldpath, newpath string) error {
|
|
return os.Rename(oldpath, newpath)
|
|
}
|