Created
March 10, 2011 21:26
-
-
Save smerritt/864961 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'fog' | |
connection = Fog::Storage.new( | |
:provider => 'AWS', | |
:aws_access_key_id => ENV["AWS_ACCESS_KEY_ID"], | |
:aws_secret_access_key => ENV["AWS_SECRET_ACCESS_KEY"] | |
) | |
# this directory has 25K+ files in it | |
file_count = connection.directories(:max_keys => 3000).get('causes-prod', :max_keys => 2000).files.size | |
puts file_count # is 1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment