Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi, I have a use case where data files are generated periodically, and I need to ingest these data files to Thingworx platform and stored. Is there a way I can monitor the directory where data files are, and trigger Thingworx to process (parse and store to database) the file when a new file is saved to the directory? thanks a lot!
There's no events for new files, but you can poll for directory changes with a Timer Thing.
This will be my last resolution, if no events, thank you.
Ping, i suppose the most basic thing here to begin with is to have an event which must fire to notify automatically whenever there's a new file added to the directory. Now if this directory is not part of the thingworx repository the event, that should fire to notify change/update, should fire on the OS's file system.
If you are working on Windows you can check the IO.FileSystemWatcher class which can be invoked from powershell(includes the sample) and then you can do a HTTP POST to ThingWorx with the file for processing
If you are on Linux it'll be inotify
hope this helps.
Thank you for your recommendation. I thought of this as well, but if I have multiple folders to monitor, creating an additional application(s) to generate this event might not be a good choice, in terms of maintainability and scalability.