# Copy task empties files (sets file length to 0)

**URL:** <https://discuss.gradle.org/t/copy-task-empties-files-sets-file-length-to-0/14588>\
**Category:** Bugs\
**Created:** [February 18, 2016, 11:06am UTC](https://discuss.gradle.org/t/copy-task-empties-files-sets-file-length-to-0/14588 "2016-02-18T11:06:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marvertin](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/marvertin/32/4474_2.png) [@marvertin](https://discuss.gradle.org/u/marvertin)\
**Post date:** [February 18, 2016, 11:06am UTC](https://discuss.gradle.org/t/copy-task-empties-files-sets-file-length-to-0/14588/1 "2016-02-18T11:06:42Z")

</div>

This simple gradle script:

```
  task copy(type: Copy) {
    from 'dirA'
    from 'dirB'
    into 'dirA'
 }

```

clear all the files in dirA directory.  
When the source and destination are same, that the tash should not do any operation.

I have a zip file with my project, but I cannot upload attachements :-(.
