windows fix

This commit is contained in:
asoseil 2017-11-30 22:26:28 +01:00
parent 0d2f8856f6
commit fb68b269fa
3 changed files with 16 additions and 11 deletions

View File

@ -80,14 +80,3 @@ func Wdir() string {
}
return dir
}
// isHidden check if a file or a path is hidden
func isHidden(path string) bool {
arr := strings.Split(path[len(Wdir()):], "/")
for _, elm := range arr {
if strings.HasPrefix(elm, ".") {
return true
}
}
return false
}

14
realize/utils_unix.go Normal file
View File

@ -0,0 +1,14 @@
package realize
import "strings"
// isHidden check if a file or a path is hidden
func isHidden(path string) bool {
arr := strings.Split(path[len(Wdir()):], "/")
for _, elm := range arr {
if strings.HasPrefix(elm, ".") {
return true
}
}
return false
}

View File

@ -1,5 +1,7 @@
package realize
import "syscall"
// isHidden check if a file or a path is hidden
func isHidden(path string) bool {
p, e := syscall.UTF16PtrFromString(path)