in assets/lambda/code/scan/lambda.py [0:0]
def create_dir(input_bucket, input_key, download_path):
"""Creates a directory at the specified location
if it does not already exists"""
sub_dir = os.path.dirname(input_key)
full_path = download_path
if len(sub_dir) > 0:
full_path = os.path.join(full_path, sub_dir)
if not os.path.exists(full_path):
try:
os.makedirs(full_path, exist_ok=True)
except OSError as e:
report_failure(input_bucket, input_key, download_path, str(e))