0

I'm on Windows in C++. I have specified folder and need to do some things every time files in that folders are somehow modified, e.g. file deletion, insertions of new files, or existing file data was modified. I'm searching at the moment about that, maybe someone can help me here.

suspectus
  • 16,548
  • 8
  • 49
  • 57
Borrimoro
  • 529
  • 3
  • 9
  • 19
  • My global approach would be to iterate through the folder's files every x miliseconds and check if their 'last modified date' has changed – Kevin Jul 29 '13 at 10:59
  • 2
    @Kevin very CPU intensive and inefficient. The OSes already provide interfaces for that, you'll only have to register yourself and listen – codeling Jul 29 '13 at 11:00
  • Does this not answer the question: http://stackoverflow.com/questions/1083372/listening-to-file-changes-in-c-c-on-windows ? – TheDarkKnight Jul 29 '13 at 11:00
  • [FileSystemWatcher](http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher%28v=vs.100%29.aspx) – BLUEPIXY Jul 29 '13 at 11:02
  • @nyarlathotep and everyone thanks a lot! Yes, seems like my question is duplicate of that – Borrimoro Jul 29 '13 at 11:05
  • @BLUEPIXY .NET is not the answer to every Windows question... – IInspectable Jul 29 '13 at 11:47

0 Answers0