Commit 8ed098a8 by rfkelly0

Dokan: fall back to calling isdir() if st_mode doesn't contain enough info.

This avoid causing breakage when the filesystem has specific permission bits
but no type bits in st_mode; fixes issue #45
parent 99fad404
...@@ -609,12 +609,12 @@ class FSOperations(object): ...@@ -609,12 +609,12 @@ class FSOperations(object):
attrs |= FILE_ATTRIBUTE_DIRECTORY attrs |= FILE_ATTRIBUTE_DIRECTORY
elif statinfo.S_ISREG(st_mode): elif statinfo.S_ISREG(st_mode):
attrs |= FILE_ATTRIBUTE_NORMAL attrs |= FILE_ATTRIBUTE_NORMAL
elif hinfo: if not attrs and hinfo:
if hinfo.contents.IsDirectory: if hinfo.contents.IsDirectory:
attrs |= FILE_ATTRIBUTE_DIRECTORY attrs |= FILE_ATTRIBUTE_DIRECTORY
else: else:
attrs |= FILE_ATTRIBUTE_NORMAL attrs |= FILE_ATTRIBUTE_NORMAL
else: if not attrs:
if self.fs.isdir(path): if self.fs.isdir(path):
attrs |= FILE_ATTRIBUTE_DIRECTORY attrs |= FILE_ATTRIBUTE_DIRECTORY
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment