Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm writing a software for periodically checking a specific range of networked devices' reach-ability. I'm specifying the address range and the time frequency for checking their reachability, in an xml file. Which technique can I use to check that xml file during the start up of the program for any modifications done in either the range or the frequency and do the necessary update in specific database?

share|improve this question
    
This is a very confusing question. You should be storing the check frequencies in config and the results of checks in a database. If you load the config at startup why do you care whether it is different from the last time you started up? –  pdr Oct 12 '12 at 13:11
    
@pdr its ok to read frequencies from config files. but what about IP address range. If the user config to check 1000s of IP addresses with in the range then its a over head to generate all those IP's every time the program starts. –  rajesh Oct 12 '12 at 14:03
    
How do you intend to do that on startup? You can't hold it in memory and reading a file or database table would be more overhead than recalculating it. –  pdr Oct 12 '12 at 14:15
add comment

1 Answer

up vote 2 down vote accepted

I´m not an expert in that topic. Maybe you can compute a hash of the file everytime you change the configuration and store it somewhere, and if you start your program you compute the hash again and compare it to the stored hash value. If you do it like that, everybody can look at the configuration file, but if anything was changed you will notice it. The question is then where to store the computed hash. This depends on the security you need.

share|improve this answer
    
thank you @Puckl for your answer. –  rajesh Oct 11 '12 at 4:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.