Commit 5d76b968 by rfkelly0

MemoryFS: include S_IFDIR or S_IFREG in st_mode

parent 8ed098a8
...@@ -11,6 +11,7 @@ If you open a file from a `memoryfs` you will get back a StringIO object from th ...@@ -11,6 +11,7 @@ If you open a file from a `memoryfs` you will get back a StringIO object from th
""" """
import datetime import datetime
import stat
from fs.path import iteratepath, pathsplit, normpath from fs.path import iteratepath, pathsplit, normpath
from fs.base import * from fs.base import *
from fs.errors import * from fs.errors import *
...@@ -503,10 +504,10 @@ class MemoryFS(FS): ...@@ -503,10 +504,10 @@ class MemoryFS(FS):
info['accessed_time'] = dir_entry.accessed_time info['accessed_time'] = dir_entry.accessed_time
if dir_entry.isdir(): if dir_entry.isdir():
info['st_mode'] = 0755 info['st_mode'] = 0755 | stat.S_IFDIR
else: else:
info['size'] = len(dir_entry.data or '') info['size'] = len(dir_entry.data or '')
info['st_mode'] = 0666 info['st_mode'] = 0666 | stat.S_IFREG
return info return info
......
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