fix os.is_dir on Windows

pull/1260/head
Alexander Medvednikov 2019-07-21 17:14:25 +02:00
parent 4d5336897e
commit 9c9fe7029e
1 changed files with 3 additions and 2 deletions

View File

@ -660,9 +660,10 @@ pub fn executable() string {
pub fn is_dir(path string) bool {
$if windows {
val := int(C.GetFileAttributes(path.to_wide()))
return dir_exists(path)
//val := int(C.GetFileAttributes(path.to_wide()))
// Note: this return is broke (wrong). we have dir_exists already how will this differ?
return (val &FILE_ATTRIBUTE_DIRECTORY) > 0
//return (val &FILE_ATTRIBUTE_DIRECTORY) > 0
}
$else {
statbuf := C.stat{}