Files
narratio/internal/fileops/rename_noreplace_linux.go

20 lines
457 B
Go
Raw Normal View History

2026-08-09 23:37:02 +00:00
//go:build linux
package fileops
import (
"os"
"golang.org/x/sys/unix"
)
2026-08-09 23:37:02 +00:00
func checkAtomicDirectoryPromotionSupport() error { return nil }
2026-08-09 23:37:02 +00:00
func renameDirectoryNoReplace(src, dst string) error {
return unix.Renameat2(unix.AT_FDCWD, src, unix.AT_FDCWD, dst, unix.RENAME_NOREPLACE)
}
func renameDirectoryNoReplaceAt(parent *os.File, src, dst string) error {
return unix.Renameat2(int(parent.Fd()), src, int(parent.Fd()), dst, unix.RENAME_NOREPLACE)
}