November 2005 November 2005 issue

Last month we were busy translating watchDirectory into German and Dutch. The German translation is now finished and available for download here.
Use the "Language" menu inside the watchDirectory Control Center to select the language you want to use. The Dutch version will follow soon (a few weeks from now).

Tip of the month: Detecting an outbreak of new files

Can watchDirectory take action when more than "x" files were created during the last "y" minutes? Yes, that is possible, but we need to do some clever batch file scripting for that.

Since the release of version 4, watchDirectory stores runtime information in an SQLite database (see www.sqlite.org) called history.db. This database has 1 row for each detected event. The "task history" program uses this database to show information about your running tasks.

The idea is to let watchDirectory start a .bat file for every new file. The .bat file inspects the history database to see how many events have fired the last "y" minutes. When there are more than "x" events present, you can take necesary action. For example, send an email alert.

The Outbreak example

Bonus Tip: Create an HTML page with the 10 most recent files

Using the same techniques as described in the previous tip, you can let watchDirectory create/update an HTML page with a "latest files" overview.

This example will select the names of the 10 most recent files from the history database. It uses a separate "header.html" and "footer.html" file for the start and end of the generated top10.html, allowing you to change the look and feel of the page created. You can use the "Upload Files" plugin to upload this file to your website.

The Top 10 example

Until next time,
Gert
Developer & Support guru

German Website deutschsprachige Webseite      French Website French Language Website      Spanish Website Spanish Language Website