Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8870577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:46:09+00:00 2026-06-14T17:46:09+00:00

In the AWS-SDK, it lists ruby code of the form: s3 = AWS::S3.new bucket

  • 0

In the AWS-SDK, it lists ruby code of the form:

 s3 = AWS::S3.new
 bucket = s3.buckets[bucket_name]
 tree = bucket.as_tree(:prefix => 'myshop/products')
 directories = tree.children.select(&:branch?).collect(&:prefix)

fail error: “Unable to find marker in S3 list objects response”

Structure of directory

/myshop/products/1474472/original.jpg
/myshop/products/1474472/small.jpg
/myshop/products/1474472/mini.jpg
/myshop/products/1333333/original.jpg
/myshop/products/1333333/small.jpg
/myshop/products/1333333/mini.jpg

…

more of 100 000 obj

I want to verify that the directory(for example “1474472”) was created

my plan: aws-s3-list-> ruby-array->find in array (array.include?)

!!!need very fast method – soon the end of the world 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:46:10+00:00Added an answer on June 14, 2026 at 5:46 pm

    There is no such stuff as folders in Amazon S3. It is a “flat” file system. Have a look into this answer.

    What you really are looking for is verifying whether a given prefix (“/myshop/products/1474472”, for instance) exists in your bucket.
    Their REST API definitely supports it, have a look into the documentation. You need to list the keys (which would be the “file names”) matching a given prefix, that can be passed as parameter. You can also optimize your call by setting the max-keys parameter to 1. That way, if you receive any non-zero amount of items in the response, the bucket already contains files with names starting with the given prefix.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to using Amazon's ruby-sdk (gem install aws-sdk), and am stuck trying
I can read from my amazon bucket, but write kept failing. s3 = AWS::S3.new
I am writing the code to grant READ permissions to all users using aws-sdk
From what I found both libraries aws-sdk and aws-s3 (Ruby) provide methods to download
Currently, the ItemCollection#query method in the Ruby AWS SDK returns the whole dataset. I
Using rails 3.1.1, Ruby 1.9.2, Gems: gem 'haml', gem 'simple_form', gem 'aws-sdk', gem 'paperclip',
I am using AWS SDK for .NET 1.5.9.0 and changed var putObjectRequest = new
My problem: require_once '/includes/aws-sdk-1.5.2/sdk.class.php'; My environment: I have a pretty standard PHP site that
Is there already a handy CI 2 library for AWS SDK 1.5.x? If not,
I am trying to do a presigned post to S3 with SWFUpload and AWS-SDK.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.