vendor tsgo

This commit is contained in:
2026-07-09 16:50:43 -04:00
parent c06ea2e5a4
commit 98978e4930
5804 changed files with 1556156 additions and 101 deletions

View File

@@ -0,0 +1,29 @@
package nativepath
import (
"syscall"
"unsafe"
)
func IsSymlinkOrReparsePoint(path string) bool {
if len(path) >= 248 {
path = `\\?\` + path
}
pathUTF16, err := syscall.UTF16PtrFromString(path)
if err != nil {
return false
}
var data syscall.Win32FileAttributeData
err = syscall.GetFileAttributesEx(
pathUTF16,
syscall.GetFileExInfoStandard,
(*byte)(unsafe.Pointer(&data)),
)
if err != nil {
return false
}
return data.FileAttributes&syscall.FILE_ATTRIBUTE_REPARSE_POINT != 0
}