implement hidden option in windows

This commit is contained in:
Gokcehan committed 2020-07-04 00:41:12 +03:00
1 parent bc2a80fd6e
commit 83a6e506d2
1 file changed
+9 -2
+9 -2
View File
@@ -115,8 +115,15 @@ func isExecutable(f os.FileInfo) bool {
} }
func isHidden(f os.FileInfo, path string) bool { func isHidden(f os.FileInfo, path string) bool {
// TODO: implement ptr, err := syscall.UTF16PtrFromString(filepath.Join(path, f.Name()))
return false if err != nil {
return false
}
attrs, err := syscall.GetFileAttributes(ptr)
if err != nil {
return false
}
return attrs&syscall.FILE_ATTRIBUTE_HIDDEN != 0
} }
func errCrossDevice(err error) bool { func errCrossDevice(err error) bool {