Hello,
if I may for each timer cycle ; I would checksum the file and retain the signature ; then when the next cycle happens:
if file_checksum != last_checksum :
____I need to do something, last_checksum = file_checksum;
else:
____do nothing
Material:
1-
you need a periodic timer ; an interesting discussion here :
http://codereview.stackexchange.com/questions/40473/portable-periodic-one-shot-timer-implementation
else win32 API:
https://msdn.microsoft.com/en-us/library/ms686289(v=vs.85).aspx
2-
you need a sha(n) hash impl
http://www.cryptopp.com might be your friend
advice: usually ; when checksumming a file ; I read per chunk/ (aligned blocks) (calculated according to the size of the file, bigger the file, bigger the block) then I update the hash context with each chunk until EOF ; it avoids you to put all the file content into memory ; downside: the reading part is a bit slower ; but the runtime part is safe.
an option/optimization in your program ; you could read the file from the end and keep an array of checksummed pre-sized blocks let say 1024, instead of a global signature ; then comparing while reading: if one of the block signature [last read] differs, no need to go further the file did change, sure you need to manage your block list as the length can change et cetera and create some rules ; don't know ; just a thought.
One day, I had implemented a fast checksum which was checking only few blocks in the beginning, in the middle, and in the end, (keeping the offsets, if the size was shrunk, you would know immediately) never got any collision on million files.
Other question: why every minute and not having a file-system watcher?
https://msdn.microsoft.com/en-us/library/aa365465(VS.85).aspx