views:

22

answers:

1

Hi, I'm using an XML file to store a set of rules that my program, a service will read and apply. Obviously, as and when I add new rules to the XML file, i will have to bounce the service so that the changes can be effective.

Is there a way I can keep 'polling' the XML file every 30s or so to avoid having to bounce my service, in the event that my XML rules file changes?

Thanks

+1  A: 

I don't know which language and platform you are using, but very often there is an OS facility to watch for file system changes. This is much more efficient than polling. .NET has a FileSystemWatcher class that lets you access this mechanism to monitor a file for changes. The Mono .NET framework also supports FileSystemWatcher although it has some specific technical requirements (see http://www.mono-project.com/FAQ:_Technical).

Try to stay away from polling on this if you can.

Tom Cabanski