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
"""
import datetime
import stat
from fs.path import iteratepath, pathsplit, normpath
from fs.base import *
from fs.errors import *
......@@ -503,10 +504,10 @@ class MemoryFS(FS):
info['accessed_time'] = dir_entry.accessed_time
if dir_entry.isdir():
info['st_mode'] = 0755
info['st_mode'] = 0755 | stat.S_IFDIR
else:
info['size'] = len(dir_entry.data or '')
info['st_mode'] = 0666
info['st_mode'] = 0666 | stat.S_IFREG
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