# rename file

**URL:** https://forum.syncthing.net/t/rename-file/11091
**Category:** General
**Created:** [December 27, 2017, 7:28pm UTC](https://forum.syncthing.net/t/rename-file/11091 "2017-12-27T19:28:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![brunod](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/b/ee7513/32.png) [@brunod](https://forum.syncthing.net/u/brunod)
#### Post date: [December 27, 2017, 7:28pm UTC](https://forum.syncthing.net/t/rename-file/11091/1 "2017-12-27T19:28:31Z")

</div>

Hi, I 'd like to understand what Syncthing does (hash, transfer…) when renaming a file on the master side and what result can be expected on the slave side. When I rename a file, I find it duplicated on the slave side. Is it “normal” ? Thanks, BD

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [December 27, 2017, 7:37pm UTC](https://forum.syncthing.net/t/rename-file/11091/2 "2017-12-27T19:37:06Z")

</div>

No, unless you have ignore deletes enabled, as rename is delete + create.

---

<div class="post-metadata">

### Author: ![brunod](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/b/ee7513/32.png) [@brunod](https://forum.syncthing.net/u/brunod)
#### Post date: [December 27, 2017, 7:50pm UTC](https://forum.syncthing.net/t/rename-file/11091/3 "2017-12-27T19:50:21Z")

</div>

Thanks for the answer. Does that mean that the file is hashed again, and the data sent a second time like if it was just another new file (and according hash, re-using what is already on the slave side) ? Btw, I supposed you meaned “create + delete”, instead of “delete + create”, that would destroy already transfered data that should be re-used.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [December 27, 2017, 8:06pm UTC](https://forum.syncthing.net/t/rename-file/11091/4 "2017-12-27T20:06:35Z")

</div>

It is hashed again, as we don’t know what the content looks like until it’s hashed.

Whether it’s re-transferred or not depends on a few factors. If it’s a rename for single files less than 4GB, if should be handled as a rename. If it’s a copy, no data should be transferred and it should be reconstructed from existing blocks. If it’s a directory tree rename, it’s likely stuff will get transferred as the creations and deletions are sent in no particular order, which can cause deletes to happen prior creates.

---

<div class="post-metadata">

### Author: ![brunod](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/b/ee7513/32.png) [@brunod](https://forum.syncthing.net/u/brunod)
#### Post date: [December 27, 2017, 8:10pm UTC](https://forum.syncthing.net/t/rename-file/11091/5 "2017-12-27T20:10:16Z")

</div>

Thank you for your explanation. 🙂
