From 5ecd07ffaf36c424780620adc95d845e0bd2bc51 Mon Sep 17 00:00:00 2001 From: Chuck Daniels Date: Mon, 13 May 2024 10:27:17 -0400 Subject: [PATCH] Create dest dir for direct access before download Fixes #562 --- earthaccess/store.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/earthaccess/store.py b/earthaccess/store.py index 67ff0c65..e56e9849 100644 --- a/earthaccess/store.py +++ b/earthaccess/store.py @@ -571,6 +571,9 @@ def _get_granules( else: print(f"Accessing cloud dataset using provider: {provider}") s3_fs = self.get_s3fs_session(provider=provider) + + local_path.mkdir(parents=True, exist_ok=True) + # TODO: make this async for file in data_links: s3_fs.get(file, str(local_path))