Skip to content

Commit

Permalink
fget_object: Delete existing file in destination path before copying (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Colhodm authored and kannappanr committed Jun 20, 2018
1 parent 6173c79 commit 9b349c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion minio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,10 @@ def fget_object(self, bucket_name, object_name, file_path, request_headers=None)
content_size)
raise InvalidSizeError(msg)

# Rename with destination file.
#Delete existing file to be compatible with Windows
if os.path.exists(file_path):
os.remove(file_path)
#Rename with destination file path
os.rename(file_part_path, file_path)

# Return the stat
Expand Down

0 comments on commit 9b349c3

Please sign in to comment.