问题
When calling the S3 ListBucket command (via either REST or SOAP API), is the result set returned in any particular order? I would expect, given the nature of object keys and markers, that the result set is always sorted by object key. But I haven't seen any documentation confirming this.
回答1:
Update: Amazon has changed their documentation as shown below.
They are returned alphabetically. List results are always returned in UTF-8 binary order. See http://docs.aws.amazon.com/AmazonS3/latest/dev/ListingKeysUsingAPIs.html
Amazon S3 exposes a list operation that lets you enumerate the keys contained in a bucket. Keys are selected for listing by bucket and prefix. For example, consider a bucket named 'dictionary' that contains a key for every English word. You might make a call to list all the keys in that bucket that start with the letter "q".
List results are always returned in lexicographic (alphabetical) orderList results are always returned in UTF-8 binary order.
来源:https://stackoverflow.com/questions/4102115/does-the-listbucket-command-guarantee-the-results-are-sorted-by-key