# Gateway Script to monitor directory for new files

**URL:** <https://forum.inductiveautomation.com/t/gateway-script-to-monitor-directory-for-new-files/16124>\
**Category:** Ignition\
**Created:** [November 26, 2017, 11:02pm UTC](https://forum.inductiveautomation.com/t/gateway-script-to-monitor-directory-for-new-files/16124 "2017-11-26T23:02:32Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Jenko](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jenko](https://forum.inductiveautomation.com/u/Jenko)\
**Post date:** [November 26, 2017, 11:02pm UTC](https://forum.inductiveautomation.com/t/gateway-script-to-monitor-directory-for-new-files/16124/1 "2017-11-26T23:02:32Z")

</div>

Hi, I’m looking for some advice as to the best way to monitor a network directory location for new files. We have an external provider that FTP’s files into a specific directory on our network, and I would like the Ignition Gateway to monitor this directory and read in the new file as a string.

From that point, I have some XML parsing code written and tested, I just can’t figure out how to monitor and get new files read in.

(For completeness - once I have read and parsed the file I will move it to an Archived location)

I have a solution working on the client level using the Instrument Interface module - but since I have a mixture of Windows and Macs on site, that solution is not universal. That’s why I would rather my Gateway (Windows Server 2012) do the monitoring in the background even when the clients are off.

Any help would be much appreciated.

Cheers

Dan

---

_[View the full topic](https://forum.inductiveautomation.com/t/gateway-script-to-monitor-directory-for-new-files/16124)._
