self.filename = filename
self.fs = fs
self.mode = mode
+ self.file_type = "file" # Set "file" as default file_type
self.__initialize__()
self.filename = filename
self.fs = fs
self.mode = mode
+ self.file_type = "file" # Set "file" as default file_type
self.__initialize__()
for directory in dir_cursor:
os.makedirs(self.path + directory.filename, exist_ok=True)
- file_cursor = self.fs.find({"metadata.type": {"$elemMatch": ["file", "sym"]}}, no_cursor_timeout=True)
+ file_cursor = self.fs.find({"metadata.type": {"$in": ["file", "sym"]}}, no_cursor_timeout=True)
for writing_file in file_cursor:
file_path = self.path + writing_file.filename
if "permissions" in writing_file.metadata:
if writing_file.metadata["type"] == "sym":
os.chmod(
- file_path,
+ file_path,
writing_file.metadata["permissions"] | stat.S_IFLNK
)
else: