Fixed issue with os module in non-unicode mode on Windows.

This commit is contained in:
Dominik Picheta
2014-08-30 12:57:42 +01:00
parent 4a7a47f294
commit fb4e54442b

View File

@@ -2013,7 +2013,10 @@ proc isHidden*(path: string): bool =
## On Unix-like systems, a file is hidden if it starts with a '.' (period)
## and is not *just* '.' or '..' ' ."
when defined(Windows):
wrapUnary(attributes, getFileAttributesW, path)
when useWinUnicode:
wrapUnary(attributes, getFileAttributesW, path)
else:
var attributes = getFileAttributesA(path)
if attributes != -1'i32:
result = (attributes and FILE_ATTRIBUTE_HIDDEN) != 0'i32
else: