Skip to content

Instantly share code, notes, and snippets.

@meeuw
Created June 5, 2013 14:50
Show Gist options
  • Save meeuw/5714430 to your computer and use it in GitHub Desktop.
Save meeuw/5714430 to your computer and use it in GitHub Desktop.
list files in cloudfiles container
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