Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A directory monitoring event is triggered when a change occurs in a directory. This change can be either:

  • addition, modification or removal  renaming removal of a file or filesdirectory

In contrast to File Watching, a directory monitoring event is triggered when a change occurs in the directory - the number of files in the directory being monitored that cause the event is not significant. Therefore a job that handles directory monitoring events would have to handle the files associated with that event.

Please note that "Changing of a file" is no directory change event. Some Texteditors renew the file when saving it, so it sometimes seems that also "Changing file" is a trigger event. But in fact this is delete and add event that triggers the job execution.

Configuring a Standalone Directory Monitoring Job 

The standard method of implementing Directory Monitoring is to start a Standalone Job every time a file is either added to or deleted from a monitored directory. In addition, a filter regular expression can be specified to restrict the monitoring to specific file namesstart the job only when at least one regex matching file is in the directory. Please note that the file that triggers the event needs not match the regular expression.

The following screen shot shows how JOE - JobScheduler Object Editor is used to configure the monitoring of a directory ./monitor_dir . Additionally, only files when at least one file with the extension txt is found in the directory, the job will be acted onstartet.

In the element tree in the left hand pane in JOE you will see the Run Options function for each job. Click on the New Dir button in the Start When Directory Changed area of the right hand pane to configure the directory that is to be monitored. Save this configuration by clicking the Apply Dir button after you have entered the monitor_dir and .*\.txt$ values in the Watch Directory and File Regex fields. Repeat this procedure to add further directories or patterns as required.

...