1
0
mirror of https://github.com/go-task/task.git synced 2025-01-14 04:35:50 +02:00
task/vendor/github.com/radovskyb/watcher/ishidden_windows.go
2019-01-19 19:25:49 -02:00

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
}