Skip to main content

We have a folder of pdf files where we want to be able to track two things -

  1. when a new file is added
  2. when an existing file is replaced with a file of the same name.

 

We have 1) working (using Directory Watcher). But I'm not sure of the best way to approach 2). I guess we could look out for situations of 1) where the file count in the directory has also increased. But I'm not clear how to accomplish that or whether that's the best approach.

 

Incidentally, these files are project drawings. And our business practice is such that when as-built info is added to the drawings, they get re-scanned and the existing file gets replaced with this new scanned file.

The Directory Watcher can be set to check for Modify as well, that should pick up case 2


The Directory Watcher can be set to check for Modify as well, that should pick up case 2

Yep, I agree that this should work. I *think* that the DirectoryWatch uses a change in file size to detect a modification rather than the Date Modified but I could be wrong there.


I tried that approach but it doesn't seem to work. When you overwrite a file with a file of the same name, I noticed that (in Windows in any case) the Date Created reflects the time the file was overwritten. So it considers it a CREATE, not a MODIFY.


Reply