# Watch node problem when a file is deleted

**URL:** <https://discourse.nodered.org/t/watch-node-problem-when-a-file-is-deleted/3426>\
**Category:** General\
**Created:** [25 September 2018 07:31 UTC](https://discourse.nodered.org/t/watch-node-problem-when-a-file-is-deleted/3426 "2018-09-25T07:31:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThanosMel](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@ThanosMel](https://discourse.nodered.org/u/ThanosMel)\
**Post date:** [25 September 2018 07:31 UTC](https://discourse.nodered.org/t/watch-node-problem-when-a-file-is-deleted/3426/1 "2018-09-25T07:31:00Z")

</div>

I am currently having an issue with watch node. I want to trigger the watch node when a new file is created in a directory but not when a file is deleted in the same directory. Is this possible by using only the watch node?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 September 2018 07:50 UTC](https://discourse.nodered.org/t/watch-node-problem-when-a-file-is-deleted/3426/2 "2018-09-25T07:50:12Z")

</div>

It will trigger for (hopefully) any action on a file in the directory being watched. - but if you look at the full msg properties - you will see that when created it should have a size - and when deleted it won't and should also have a type of "none".

This may be OS dependant - but either way you should be able to work out what was a delete and what was a create.

---

<div class="post-metadata">

**Author:** ![ThanosMel](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@ThanosMel](https://discourse.nodered.org/u/ThanosMel)\
**Post date:** [25 September 2018 08:00 UTC](https://discourse.nodered.org/t/watch-node-problem-when-a-file-is-deleted/3426/3 "2018-09-25T08:00:12Z")

</div>

Thanks for the quick answer i had already noticed the size attribute but i didn't know about type. Problem solved
