2026-08-09 23:37:02 +00:00
|
|
|
//go:build linux
|
|
|
|
|
|
|
|
|
|
package fileops
|
|
|
|
|
|
2026-08-10 18:14:09 +00:00
|
|
|
import (
|
|
|
|
|
"os"
|
|
|
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
|
|
|
|
)
|
2026-08-09 23:37:02 +00:00
|
|
|
|
2026-08-10 01:58:52 +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)
|
|
|
|
|
}
|
2026-08-10 18:14:09 +00:00
|
|
|
|
|
|
|
|
func renameDirectoryNoReplaceAt(parent *os.File, src, dst string) error {
|
|
|
|
|
return unix.Renameat2(int(parent.Fd()), src, int(parent.Fd()), dst, unix.RENAME_NOREPLACE)
|
|
|
|
|
}
|