fork/gdu

git clone https://git.julia.blue/fork/gdu

cosmolifeat: move items to XDG trash with D key (#12) (#608)9ca5c60

ignore
289 B17 linesraw
1//go:build linux
2
3package remove
4
5import (
6	"os"
7
8	"golang.org/x/sys/unix"
9)
10
11func renameNoReplace(oldpath, newpath string) error {
12	err := unix.Renameat2(unix.AT_FDCWD, oldpath, unix.AT_FDCWD, newpath, unix.RENAME_NOREPLACE)
13	if err == unix.EEXIST {
14		return os.ErrExist
15	}
16	return err
17}