.InclusionFilter // array of strings
.ExclusionFilter // array of strings


These two properties instruct the FsWatcher to include or exclude specific file-masks.
By default, InclusionFilter is ['*'], so it includes everything, and ExclusionFilter is empty, so nothing will be excluded.


Example:


{
 ConsoleFeedback = true;
 var scli = new SftpClient();
 scli.Host = 'your.sftpserver.com:22';
 scli.User = 'some_username';
 scli.PassFromSecret = 'name_of_the_secret_password';
 if (scli.Connect()) {
  watchr = new FsWatcher();
  watchr.WatchDir('C:\\Docs', true);
  watchr.InclusionFilter = ['*.docx', '*.xlsx'] // include only *.docx and *.xlsx files
  watchr.ExclusionFilter = ['some_private_document.docx'] // exclude this one specific file
  watchr.Start(); 
  while (true) {
   Sleep(1000);
   if (HaltSignalReceived) {
    break;
   }
   evt = watchr.Events()
   if (evt.length > 0) {
    for (var i = 0; i < evt.length; i++) {
     if (evt[i].Event == 'WRITE') {
      scli.UploadWithPath(evt[i].Object, '/realtimebackup', 0);
     }
    }   
   }
  } 
  scli.Close();   
 } 
 scli = nil;
}