MCPcopy Create free account
hub / github.com/cli/cli / classifyWindowsPathRedirect

Function classifyWindowsPathRedirect

internal/safepaths/link_windows.go:22–37  ·  view source on GitHub ↗
(info os.FileInfo, readlink func() error)

Source from the content-addressed store, hash-verified

20}
21
22func classifyWindowsPathRedirect(info os.FileInfo, readlink func() error) (bool, error) {
23 if info.Mode()&os.ModeSymlink != 0 {
24 return true, nil
25 }
26 data, ok := info.Sys().(*syscall.Win32FileAttributeData)
27 if !ok || data.FileAttributes&syscall.FILE_ATTRIBUTE_REPARSE_POINT == 0 {
28 return false, nil
29 }
30 if err := readlink(); err != nil {
31 if os.IsNotExist(err) {
32 return false, errUnsupportedNonLinkReparse
33 }
34 return false, err
35 }
36 return true, nil
37}

Callers 2

isPathRedirectFunction · 0.85

Calls 2

ModeMethod · 0.80
SysMethod · 0.80

Tested by 1