Files
netbird/util/file_nonwindows.go
T
Theodor Midtlien 4c19226342 [client] Use POSIX style file read/write of json for windows (#7631)
* Use POSIX-like file read/write of json for windows + tests: allow renaming an open file.
2026-09-24 10:23:50 +02:00

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)
}