Skip to content

Commit

Permalink
fix: get file missing dir
Browse files Browse the repository at this point in the history
  • Loading branch information
MehmedGIT committed Sep 30, 2023
1 parent f2e63ba commit d5954b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/operandi_utils/hpc/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ def mkdir_p(self, remotepath, mode=0o766):
return True

def get_file(self, remote_src, local_dst):
makedirs(name=Path(local_dst).parent.absolute(), exist_ok=True)
self.sftp.get(remotepath=remote_src, localpath=local_dst)

def get_dir(self, remote_src, local_dst, mode=0o766):
Expand All @@ -257,7 +258,7 @@ def get_dir(self, remote_src, local_dst, mode=0o766):
item_src = join(remote_src, item)
item_dst = join(local_dst, item)
if S_ISDIR(self.sftp.lstat(item_src).st_mode):
makedirs(name=item_dst, mode=mode, exist_ok=True)
makedirs(name=local_dst, mode=mode, exist_ok=True)
self.get_dir(remote_src=item_src, local_dst=item_dst, mode=mode)
else:
self.get_file(remote_src=item_src, local_dst=item_dst)
Expand Down

0 comments on commit d5954b7

Please sign in to comment.