title: How to delete a folder in s3?
body: <p>I have the following hierarchy in my s3 bucket</p>
  
  <pre><code>bucket_name/folder1/folder2/file1
  bucket_name/folder1/folder2/file1
  </code></pre>
  
  <p>I am able to delete all the files within folder2, but that leaves the bucket with empty folders as folder1/folder2.</p>
  
  <p>What is the appropriate way of deleting those folders?</p>
  
  <p>Here is what I do to delete a particular file:</p>
  
  <p>Where <code>s3</code> is my Amazon s3 instance:</p>
  
  <pre><code>s3.buckets[my_bucket_name].objects[path].delete
  </code></pre>
  
  <p>Ideally I would like to delete the folders an all the contents.</p>