From 9c9fe7029e50306e0157dc17df477b444839380e Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 21 Jul 2019 17:14:25 +0200 Subject: [PATCH] fix os.is_dir on Windows --- vlib/os/os.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vlib/os/os.v b/vlib/os/os.v index de38d86c4e..d9e5669bbc 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -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{}