amazon web services - Ruby: use aws-sdk to list s3 objects with marker and max-keys -


i found there has no example in aws-sdk document list s3 objects marker , max-keys options.

in java, can :

objectlisting objectlisting = s3.listobjects(new listobjectsrequest() .withbucketname(bucket) .withprefix(s3prefix) .withmarker(s3marker) .withmaxkeys(40)); 

but in ruby, can find with_prefix method no way fill other options. please tell how config list objects marker or max-kays

it took me while figure out, same reasons: no examples in documents.

here how managed working, however:

items = bucket.objects.with_prefix(prefix).page(:next_token => { :marker => marker }, :per_page => 100) items.each |item|     puts item.key end 

items pageresult object.

i figured out using combination of aws docs , reading source code.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -