20 lines
457 B
Go
20 lines
457 B
Go
//go:build linux
|
|
|
|
package fileops
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func checkAtomicDirectoryPromotionSupport() error { return nil }
|
|
|
|
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)
|
|
}
|