Skip to content

Commit

Permalink
MPU: Init staging dirs if not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghua committed Sep 21, 2024
1 parent 000eed9 commit b79437a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tosfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2060,6 +2060,12 @@ def __init__(
self.append_block = True
self.loc = loc

if "w" in mode:
# check the local staging dir if not exist, create it
for staging_dir in fs.multipart_staging_dirs:
if not os.path.exists(staging_dir):
os.makedirs(staging_dir)

def _initiate_upload(self) -> None:
"""Create remote file/upload."""
if self.autocommit and not self.append_block and self.tell() < self.blocksize:
Expand Down

0 comments on commit b79437a

Please sign in to comment.