This project contains a file system watcher class. The class can watch a single directory or a directory tree for selected changes. Class files can be included, linked via SLL's, or used from a DLL. DLL is included in the zip file. Simple examples for PBCC 6 and PBWin 10 are included.To start watching the following lines may be used:

  LOCAL fsw AS iFilesystemWatcher 
  CALL StartFilesystemWatcher( fsw, "c:\test\", CODEPTR( OnChange ), %fsWatchFor.ALL, 1 )
You can watch for any of the following:
ENUM fsWatchFor 
  Filename = &H1 
  DirectoryName = &H2 
  Attributes = &H4 
  Size = &H8 
  Write = &H10 
  Access = &H20 
  Creation = &H40 
  Security = &H100 
  All = &H17f
END ENUM
Notice of selected changes are sent to a notifcation function with the following signature:
SUB OnChange( filename AS WSTRING, BYVAL changeEvent AS LONG ) 
  ' Your code here 
END SUB
A changeEvent can have one of the following values:
ENUM fsEvent 
  Added = 1 
  Removed = 2 
  Modified = 3 
  OldName = 4 
  NewName = 5
END ENUM