Created
June 5, 2013 14:50
-
-
Save meeuw/5714430 to your computer and use it in GitHub Desktop.
list files in cloudfiles container
This file contains 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
import cloudfiles | |
import sys | |
conn = cloudfiles.get_connection( | |
'username', | |
'apikey', | |
authurl=cloudfiles.uk_authurl | |
) | |
container = conn.get_container(sys.argv[1]) | |
marker = None | |
limit = 5000 | |
while 1: | |
list_objects_info = container.list_objects_info(marker=marker, limit=limit) | |
for object_info in list_objects_info: print object_info['name'] | |
marker = object_info['name'] | |
if len(list_objects_info) < limit: break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment