Return the original rename error unless the move crosses filesystems. Permission and sharing errors must not start a copy-and-delete operation that can leave the destination behind or remove source contents. Preserve the source Windows symlink's file or directory kind rather than inferring it from a target that may not exist at the destination yet. Keep relative targets, Developer Mode handling and long-path support. Cover rename failures, Linux cross-device moves and Windows link kinds, and run the focused session tests natively in Windows CI.
15 lines
198 B
Go
15 lines
198 B
Go
//go:build !windows
|
|
|
|
package sessions
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
const crossDeviceErr = syscall.EXDEV
|
|
|
|
func copySymlink(target, to string, _ os.FileInfo) error {
|
|
return os.Symlink(target, to)
|
|
}
|