Skip to content

Commit

Permalink
* s3cmd: Fixed 'get' conflict.
Browse files Browse the repository at this point in the history
git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@269 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information
ludvigm committed Nov 25, 2008
1 parent d42ebe3 commit bc022c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
@@ -1,5 +1,6 @@
2008-11-24 Michal Ludvig <michal@logix.cz>

* s3cmd: Fixed 'get' conflict.
* s3cmd.1, TODO: Document 'mv' command.

2008-11-24 Michal Ludvig <michal@logix.cz>
Expand Down
4 changes: 3 additions & 1 deletion s3cmd
Expand Up @@ -267,15 +267,17 @@ def cmd_object_get(args):
else:
## File
try:
file_exists = os.path.exists(destination)
dst_stream = open(destination, "ab")
if os.path.exists(destination):
if file_exists:
if Config().get_continue:
start_position = dst_stream.tell()
elif Config().force:
start_position = 0L
dst_stream.seek(0L)
dst_stream.truncate()
else:
dst_stream.close()
raise ParameterError("File %s already exists. Use either --force or --continue or give it a new name." % destination)
except IOError, e:
error("Skipping %s: %s" % (destination, e.strerror))
Expand Down

0 comments on commit bc022c6

Please sign in to comment.