1
0
mirror of https://github.com/rclone/rclone.git synced 2025-10-06 05:47:10 +02:00
Files
rclone/backend/local/symlink.go
2025-08-22 00:07:58 +01:00

23 lines
430 B
Go

//go:build !windows && !plan9 && !js && !wasm
package local
import (
"os"
"syscall"
)
// isCircularSymlinkError checks if the current error code is because of a circular symlink
func isCircularSymlinkError(err error) bool {
if err != nil {
if newerr, ok := err.(*os.PathError); ok {
if errcode, ok := newerr.Err.(syscall.Errno); ok {
if errcode == syscall.ELOOP {
return true
}
}
}
}
return false
}