Skip to content

Commit

Permalink
Merge bfa6b96 into 81c9bc0
Browse files Browse the repository at this point in the history
  • Loading branch information
rockuw committed Nov 7, 2016
2 parents 81c9bc0 + bfa6b96 commit 813ab8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/aliyun/oss/download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def commit

parts = sync_get_all_parts
# concat all part files into the target file
File.open(@file, 'w') do |w|
File.open(@file, 'wb') do |w|
parts.sort{ |x, y| x[:number] <=> y[:number] }.each do |p|
File.open(get_part_file(p)) do |r|
w.write(r.read(READ_SIZE)) until r.eof?
Expand Down Expand Up @@ -177,7 +177,7 @@ def download_part(p)
logger.debug("Begin download part: #{p}")

part_file = get_part_file(p)
File.open(part_file, 'w') do |w|
File.open(part_file, 'wb') do |w|
@protocol.get_object(
bucket, object,
@options.merge(range: p[:range])) { |chunk| w.write(chunk) }
Expand Down
2 changes: 1 addition & 1 deletion lib/aliyun/oss/multipart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def write_checkpoint(states, file)
md5= Util.get_content_md5(states.to_json)

@mutex.synchronize {
File.open(file, 'w') {
File.open(file, 'wb') {
|f| f.write(states.merge(md5: md5).to_json)
}
}
Expand Down

0 comments on commit 813ab8a

Please sign in to comment.