Announcement

Collapse
No announcement yet.

Plugin to trigger event on file update?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Plugin to trigger event on file update?

    There are several scripts that I have which read output from files generated from other programs running on my HS box (for example, Jon00's SpeedFan script and the Cumulus script, also hosted by Jon00).

    The problem is that you have to run these scripts on a recurring interval, and that window does not directly coincide with the file update interval, so the worst case scenario is the actual update occurs almost as long as the sum of the two intervals. For example, if Cumulus updates its realtime file every 30 seconds, and my Cumulus import script triggers every minute, the data is at worst as much as 89 seconds old, and the only way to reduce this is to decrease the update intervals, unnecessarily increasing the amount of empty work the CPU & filesystem do.

    So my question is this: has anyone (or would anyone) write a plug-in to monitor a file for its update, then trigger a user-selectable script? VB.net has the FileSystemWatcher class which can apparantly do this. Problem is I do not have the coding skillz to write said plug-in. I am trying to write a script using System.IO.File.GetLastWriteTime, but the problem is that this script would have to be triggered, effectively adding back in a time-wasting interval.

    And...discuss.

    -BD
Working...
X