Skip to content

Commit

Permalink
Update macrecovery.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nimafanniasl committed Aug 16, 2024
1 parent 8ee5b37 commit 87769a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Utilities/macrecovery/macrecovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ def save_image(url, sess, filename='', directory=''):
if filename.find(os.sep) >= 0 or filename == '':
raise RuntimeError('Invalid save path ' + filename)

path = os.path.join(directory, filename)
print(path, directory, filename)
if os.path.isfile(path):
print(f"File {filename} already exists, Skipping...")

print(f'Saving {url} to {directory}{os.sep}{filename}...')

with open(os.path.join(directory, filename), 'wb') as fh:
Expand Down

0 comments on commit 87769a3

Please sign in to comment.