bubbles/filepicker/hidden_windows.go
Maas Lalani 3372cf1aea
Filepicker Bubble (#343)
* feat: filepicker bubble

* fix: bump bubbles to 1.16

* fix: allow customization of empty state

* fix: change `Enter` to `Open`

* fix: lint gomnd

* fix: don't send msg, instead check if this update caused a selection
2023-03-06 10:59:59 -05:00

22 lines
423 B
Go

//go:build windows
// +build windows
package filepicker
import (
"syscall"
)
// IsHidden reports whether a file is hidden or not.
func IsHidden(file string) (bool, error) {
pointer, err := syscall.UTF16PtrFromString(file)
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
}