def __update_local_fs(self, from_path=None):
dir_cursor = self.fs.find({"metadata.type": "dir"}, no_cursor_timeout=True)
+ valid_paths = []
+
for directory in dir_cursor:
if from_path and not directory.filename.startswith(from_path):
continue
os.makedirs(self.path + directory.filename, exist_ok=True)
+ valid_paths.append(self.path + directory.filename)
file_cursor = self.fs.find(
{"metadata.type": {"$in": ["file", "sym"]}}, no_cursor_timeout=True
raise
os.symlink(link, file_path)
else:
+ folder = os.path.dirname(file_path)
+ if folder not in valid_paths:
+ os.makedirs(folder, exist_ok=True)
with open(file_path, "wb+") as file_stream:
self.fs.download_to_stream(writing_file._id, file_stream)
if "permissions" in writing_file.metadata: