Skip to content

Commit

Permalink
added file closure and renamed method to copy_to_local
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Dempsey committed Jun 20, 2011
1 parent e0338cf commit 9afdcb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/swineherd/filesystem/s3filesystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,14 @@ def cp srcpath, dstpath
end

# right now this only works on single files
def cp_to_local srcpath, dstpath
def copy_to_local srcpath, dstpath
src_bucket = bucket(srcpath)
src_key_path = key_path(srcpath)
dstfile = File.new(dstpath, 'w')
@s3.interface.get(src_bucket, src_key_path) do |chunk|
dstfile.write(chunk)
end
dstfile.close
end

# This is a bit funny, there's actually no need to create a 'path' since
Expand Down

0 comments on commit 9afdcb3

Please sign in to comment.