realize/realize/utils_windows.go

19 lines
337 B
Go
Raw Normal View History

2017-11-30 21:31:21 +00:00
// +build windows
2017-11-25 15:08:52 +00:00
package realize
2017-11-30 21:26:28 +00:00
import "syscall"
2017-11-25 15:08:52 +00:00
// isHidden check if a file or a path is hidden
func isHidden(path string) bool {
p, e := syscall.UTF16PtrFromString(path)
if e != nil {
return false
}
attrs, e := syscall.GetFileAttributes(p)
if e != nil {
return false
}
return attrs&syscall.FILE_ATTRIBUTE_HIDDEN != 0
}