title: S3DistCp (AWS-EMR) - deleteOnSuccess option creates file on source bucket
body: <p>I'm working on an AWS-EMR cluster and added a step to run S3DISTCP (<a href="https://docs.aws.amazon.com/es_es/emr/latest/ReleaseGuide/UsingEMR_s3distcp.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/es_es/emr/latest/ReleaseGuide/UsingEMR_s3distcp.html</a>), this is in order to copy objects from an s3 bucket (target/destination is also an s3 bucket). </p>
  
  <p>Objects are copied correctly to the destination bucket and using <code>--deleteOnSuccess</code> option copied objects deleted from source bucket as expected. The problem here is, for every folder that contained a copied object (on the source bucket), there is a new file created at the root of the source bucket (this only happens with <code>--deleteOnSuccess</code> option).</p>
  
  <p>Arguments that I use are:</p>
  
  <pre><code>s3-dist-cp --s3Endpoint=s3.amazonaws.com --src=s3://MY_SOURCE_BUCKET/ --dest=s3://MY_DESTINATION_BUCKET/ --srcPrefixesFile=s3://ANOTHER_BUCKET/objects_list.txt --deleteOnSuccess
  </code></pre>
  
  <p>In this case, if in <code>s3://MY_SOURCE_BUCKET/</code> contains:</p>
  
  <pre><code>s3://MY_SOURCE_BUCKET/
       |--folder_a/
       |      |------ a.txt
       |      |------ b.txt
       |      |------ c.txt
       |--folder_b/
              |------ d.txt
  </code></pre>
  
  <p>and if I want to copy and delete only <code>s3://MY_SOURCE_BUCKET/folder_a/b.txt</code>, once S3DISTCP run is completed, source bucket looks like:</p>
  
  <pre><code>s3://MY_SOURCE_BUCKET/
       |--folder_a_$folder$    &lt;-- This is the new file created with `_$folder$` suffix
       |--folder_a/
       |      |------ a.txt
       |      |------ c.txt
       |--folder_b/
              |------ d.txt
  </code></pre>
  
  <p>Is there a way to avoid this new files are created by S3DISTCP on the source bucket?</p>