"""
log.debug("Copying %s to %s" % (src, dst))
- path = os.path.dirname(dst)
+ # Create parent directory
+ await self.make_parent_directory(dst)
+
+ # Copy data without any metadata
+ await asyncio.to_thread(shutil.copyfile, src, dst)
+
+ async def make_parent_directory(self, path):
+ """
+ Creates the parent directory of path
+ """
+ path = os.path.dirname(path)
# Create destination path (if it does not exist)
try:
except FileExistsError:
pass
- # Copy data without any metadata
- await asyncio.to_thread(shutil.copyfile, src, dst)
-
async def unlink(self, path):
"""
Unlinks path