gowebbuild/vendor/github.com/radovskyb/watcher/ishidden_windows.go

22 lines
354 B
Go

// +build windows
package watcher
import (
"syscall"
)
func isHiddenFile(path string) (bool, error) {
pointer, err := syscall.UTF16PtrFromString(path)
if err != nil {
return false, err
}
attributes, err := syscall.GetFileAttributes(pointer)
if err != nil {
return false, err
}
return attributes&syscall.FILE_ATTRIBUTE_HIDDEN != 0, nil
}