mirror of
https://github.com/charmbracelet/bubbles.git
synced 2026-07-22 11:39:28 -06:00
* 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
22 lines
423 B
Go
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
|
|
}
|