Permalink
Browse files

added put method to s3 fs

  • Loading branch information...
1 parent 3315063 commit d7d9d908745326a22f8877a49400f5aff6877e7f Travis Dempsey committed Jun 6, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/swineherd/filesystem/s3filesystem.rb
@@ -195,6 +195,16 @@ def common_directory paths
uncommon_idx = dirs.transpose.each_with_index.find{|dirnames, idx| dirnames.uniq.length > 1}.last
dirs[0][0...uncommon_idx].join('/')
end
+
+ def put srcpath, destpath
+ dest_bucket = bucket(destpath)
+ if File.directory? srcpath
+
+ else
+ key = srcpath
+ end
+ @s3.interface.put(dest_path, key, File.open(srcpath))
+ end
def close *args
end

0 comments on commit d7d9d90

Please sign in to comment.